org.eclipse.rdf4j.sail.lucene

## Class LuceneDocument

- java.lang.Object
- - org.eclipse.rdf4j.sail.lucene.LuceneDocument

- All Implemented Interfaces:
    SearchDocument

      public class LuceneDocument
      extends Object
      implements SearchDocument

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LuceneDocument()` Deprecated.
    `LuceneDocument(org.apache.lucene.document.Document doc, com.google.common.base.Function<? super String,? extends org.apache.lucene.spatial.SpatialStrategy> geoStrategyMapper)`
    `LuceneDocument(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)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `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.
    `String` | `getContext()`
    `org.apache.lucene.document.Document` | `getDocument()`
    `String` | `getId()`
    `List<String>` | `getProperty(String name)`
    `Set<String>` | `getPropertyNames()` Returns a set of the property names.
    `String` | `getResource()`
    `boolean` | `hasProperty(String fieldName, String value)` Checks whether a field occurs with a specified value in a Document.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LuceneDocument

          @Deprecated
          public LuceneDocument()

      Deprecated.
      To be removed, no longer used.

    - #### 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

          public LuceneDocument(String id,
                                String resourceId,
                                String context,
                                com.google.common.base.Function<? super String,? extends org.apache.lucene.spatial.SpatialStrategy> geoStrategyMapper)

  - ### Method Detail

    - #### getDocument

          public org.apache.lucene.document.Document getDocument()

    - #### getId

          public String getId()

      Specified by:
        `getId` in interface `SearchDocument`

    - #### getResource

          public String getResource()

      Specified by:
        `getResource` in interface `SearchDocument`

    - #### getContext

          public String getContext()

      Specified by:
        `getContext` in interface `SearchDocument`

    - #### getPropertyNames

          public Set<String> getPropertyNames()

      Description copied from interface: `SearchDocument`
      Returns a set of the property names.
      Specified by:
        `getPropertyNames` in interface `SearchDocument`

    - #### addProperty

          public void addProperty(String name)

      Description copied from interface: `SearchDocument`
      Adds/creates a new property with the given name.
      Specified by:
        `addProperty` in interface `SearchDocument`

    - #### addProperty

          public void addProperty(String name,
                                  String text)

      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 interface `SearchDocument`
      See Also:
        `LuceneSail`

    - #### hasProperty

          public boolean hasProperty(String fieldName,
                                     String value)

      Checks whether a field occurs with a specified value in a Document.
      Specified by:
        `hasProperty` in interface `SearchDocument`

    - #### getProperty

          public List<String> getProperty(String name)

      Specified by:
        `getProperty` in interface `SearchDocument`

    - #### addGeoProperty

          public void addGeoProperty(String field,
                                     String value)

      Specified by:
        `addGeoProperty` in interface `SearchDocument`

Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.