public abstract class AbstractSearchIndex extends Object implements SearchIndex
Modifier and Type | Field and Description |
---|---|
protected int |
maxDocs |
protected Set<String> |
wktFields |
Constructor and Description |
---|
AbstractSearchIndex() |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Literal literal)
Returns whether the provided literal is accepted by the LuceneIndex to be indexed.
|
protected abstract void |
addDocument(SearchDocument doc) |
void |
addDocuments(Resource subject,
List<Statement> statements)
Add a complete Lucene Document based on these statements.
|
void |
addRemoveStatements(Collection<Statement> added,
Collection<Statement> removed)
Add many statements at the same time, remove many statements at the same time.
|
void |
addStatement(Statement statement)
Indexes the specified Statement.
|
protected abstract SearchDocument |
copyDocument(SearchDocument doc) |
protected abstract void |
deleteDocument(SearchDocument doc) |
Collection<BindingSet> |
evaluate(QuerySpec query)
Deprecated.
|
Collection<BindingSet> |
evaluate(SearchQueryEvaluator evaluator) |
protected abstract Iterable<? extends DocumentDistance> |
geoQuery(IRI geoProperty,
org.locationtech.spatial4j.shape.Point p,
IRI units,
double distance,
String distanceVar,
Var context) |
protected abstract Iterable<? extends DocumentResult> |
geoRelationQuery(String relation,
IRI geoProperty,
String wkt,
Var context) |
protected abstract SearchDocument |
getDocument(String id) |
protected abstract Iterable<? extends SearchDocument> |
getDocuments(String resourceId) |
protected Resource |
getResource(SearchDocument document)
Returns the Resource corresponding with the specified Document.
|
protected abstract org.locationtech.spatial4j.context.SpatialContext |
getSpatialContext(String property) |
void |
initialize(Properties parameters) |
boolean |
isGeoField(String fieldName)
Returns true if the given property contains a geometry.
|
protected abstract BulkUpdater |
newBulkUpdate() |
protected abstract SearchDocument |
newDocument(String id,
String resourceId,
String context) |
protected Object |
parseLuceneQueryShape(String property,
String value) |
protected abstract SearchQuery |
parseQuery(String q,
IRI property)
Deprecated.
|
protected org.locationtech.spatial4j.shape.Shape |
parseQueryPoint(String property,
String value) |
protected org.locationtech.spatial4j.shape.Shape |
parseQueryShape(String property,
String value) |
protected abstract Iterable<? extends DocumentScore> |
query(Resource subject,
String q,
IRI property,
boolean highlight) |
void |
removeStatement(Statement statement)
Removes the specified Statement from the indexes.This should be called from within a begin-commit-rollback
block.
|
protected abstract void |
updateDocument(SearchDocument doc) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
begin, beginReading, clear, clearContexts, commit, endReading, rollback, shutDown
public void initialize(Properties parameters) throws Exception
initialize
in interface SearchIndex
Exception
protected abstract org.locationtech.spatial4j.context.SpatialContext getSpatialContext(String property)
public boolean accept(Literal literal)
accept
in interface SearchIndex
literal
- the literal to be acceptedpublic boolean isGeoField(String fieldName)
SearchIndex
isGeoField
in interface SearchIndex
public final void addStatement(Statement statement) throws IOException
addStatement
in interface SearchIndex
IOException
public final void removeStatement(Statement statement) throws IOException
SearchIndex
removeStatement
in interface SearchIndex
IOException
public final void addRemoveStatements(Collection<Statement> added, Collection<Statement> removed) throws IOException
addRemoveStatements
in interface SearchIndex
added
- all added statements, can have multiple subjectsremoved
- all removed statements, can have multiple subjectsIOException
public final void addDocuments(Resource subject, List<Statement> statements) throws IOException
addDocuments
in interface SearchIndex
statements
- the statements that make up the resourceIOException
@Deprecated public Collection<BindingSet> evaluate(QuerySpec query) throws SailException
evaluate(SearchQueryEvaluator)
.evaluate
in interface SearchIndex
SailException
public final Collection<BindingSet> evaluate(SearchQueryEvaluator evaluator) throws SailException
evaluate
in interface SearchIndex
SailException
protected Object parseLuceneQueryShape(String property, String value) throws ParseException, IOException
ParseException
IOException
protected org.locationtech.spatial4j.shape.Shape parseQueryShape(String property, String value) throws ParseException
ParseException
protected org.locationtech.spatial4j.shape.Shape parseQueryPoint(String property, String value) throws ParseException
ParseException
protected Resource getResource(SearchDocument document)
protected abstract SearchDocument getDocument(String id) throws IOException
IOException
protected abstract Iterable<? extends SearchDocument> getDocuments(String resourceId) throws IOException
IOException
protected abstract SearchDocument newDocument(String id, String resourceId, String context)
protected abstract SearchDocument copyDocument(SearchDocument doc)
protected abstract void addDocument(SearchDocument doc) throws IOException
IOException
protected abstract void updateDocument(SearchDocument doc) throws IOException
IOException
protected abstract void deleteDocument(SearchDocument doc) throws IOException
IOException
@Deprecated protected abstract SearchQuery parseQuery(String q, IRI property) throws MalformedQueryException
MalformedQueryException
protected abstract Iterable<? extends DocumentScore> query(Resource subject, String q, IRI property, boolean highlight) throws MalformedQueryException, IOException
MalformedQueryException
IOException
protected abstract Iterable<? extends DocumentDistance> geoQuery(IRI geoProperty, org.locationtech.spatial4j.shape.Point p, IRI units, double distance, String distanceVar, Var context) throws MalformedQueryException, IOException
MalformedQueryException
IOException
protected abstract Iterable<? extends DocumentResult> geoRelationQuery(String relation, IRI geoProperty, String wkt, Var context) throws MalformedQueryException, IOException
MalformedQueryException
IOException
protected abstract BulkUpdater newBulkUpdate()
Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.