Class LuceneDocument
java.lang.Object
org.eclipse.rdf4j.sail.lucene.impl.LuceneDocument
- All Implemented Interfaces:
SearchDocument
-
Constructor Summary
ConstructorDescriptionLuceneDocument
(com.google.common.base.Function<? super String, ? extends org.apache.lucene.spatial.SpatialStrategy> geoStrategyMapper) LuceneDocument
(String id, String resourceId, String context, com.google.common.base.Function<? super String, ? extends org.apache.lucene.spatial.SpatialStrategy> geoStrategyMapper) LuceneDocument
(org.apache.lucene.document.Document doc, com.google.common.base.Function<? super String, ? extends org.apache.lucene.spatial.SpatialStrategy> geoStrategyMapper) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addGeoProperty
(String field, String value) void
addProperty
(String name) Adds/creates a new property with the given name.void
addProperty
(String name, String text) Stores and indexes a property in a Document.org.apache.lucene.document.Document
getId()
getProperty
(String name) Returns a set of the property names.boolean
hasProperty
(String fieldName, String value) Checks whether a field occurs with a specified value in a Document.
-
Constructor Details
-
LuceneDocument
public LuceneDocument(com.google.common.base.Function<? super String, ? extends org.apache.lucene.spatial.SpatialStrategy> geoStrategyMapper) -
LuceneDocument
public LuceneDocument(org.apache.lucene.document.Document doc, com.google.common.base.Function<? super String, ? extends org.apache.lucene.spatial.SpatialStrategy> geoStrategyMapper) -
LuceneDocument
-
-
Method Details
-
getDocument
public org.apache.lucene.document.Document getDocument() -
getId
- Specified by:
getId
in interfaceSearchDocument
-
getResource
- Specified by:
getResource
in interfaceSearchDocument
-
getContext
- Specified by:
getContext
in interfaceSearchDocument
-
getPropertyNames
Description copied from interface:SearchDocument
Returns a set of the property names.- Specified by:
getPropertyNames
in interfaceSearchDocument
-
addProperty
Description copied from interface:SearchDocument
Adds/creates a new property with the given name.- Specified by:
addProperty
in interfaceSearchDocument
-
addProperty
Stores and indexes a property in a Document. We don't have to recalculate the concatenated text: just add another TEXT field and Lucene will take care of this. Additional advantage: Lucene may be able to handle the invididual strings in a way that may affect e.g. phrase and proximity searches (concatenation basically means loss of information). NOTE: The TEXT_FIELD_NAME has to be stored, see in LuceneSail- Specified by:
addProperty
in interfaceSearchDocument
- See Also:
-
hasProperty
Checks whether a field occurs with a specified value in a Document.- Specified by:
hasProperty
in interfaceSearchDocument
-
getProperty
- Specified by:
getProperty
in interfaceSearchDocument
-
addGeoProperty
- Specified by:
addGeoProperty
in interfaceSearchDocument
-