org.hibernate.search.engine.impl

## Class LuceneOptionsImpl

- java.lang.Object
- - org.hibernate.search.engine.impl.LuceneOptionsImpl

- All Implemented Interfaces:
    LuceneOptions

      public class LuceneOptionsImpl
      extends Object
      implements LuceneOptions

  A wrapper class for Lucene parameters needed for indexing.
  Author:
    Hardy Ferentschik, Sanne Grinovero, Gustavo Fernandes

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LuceneOptionsImpl(DocumentFieldMetadata fieldMetadata, float fieldLevelBoost, float inheritedBoost)`
    `LuceneOptionsImpl(Field.Index indexMode, Field.TermVector termVector, Store store, String indexNullAs, float fieldLevelBoost, float inheritedBoost)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDoubleFieldToDocument(String fieldName, double doubleValue, Document document)`
    `void` | `addFieldToDocument(String name, String indexedString, Document document)` Add a new field with the name `fieldName` to the Lucene Document `document` using the value `indexedString`.
    `void` | `addFloatFieldToDocument(String fieldName, float floatValue, Document document)`
    `void` | `addIntFieldToDocument(String fieldName, int intValue, Document document)`
    `void` | `addLongFieldToDocument(String fieldName, long longValue, Document document)`
    `void` | `addNumericDocValuesFieldToDocument(String fieldName, Number numericValue, Document document)` Add a new numeric doc values field with the name `fieldName` to the Lucene Document `document` using the value `numericValue`.
    `void` | `addNumericFieldToDocument(String fieldName, Object indexedValue, Document document)` Add a new NumericField with the name `fieldName` to the Lucene Document `document` using the value `numericValue`.
    `void` | `addSortedDocValuesFieldToDocument(String fieldName, String indexedString, Document document)` Add a new sorted doc values field with the name `fieldName` to the Lucene Document `document` using the value `indexedString`.
    `float` | `getBoost()` Deprecated.
    `Field.Index` | `getIndex()` Prefer the use of `LuceneOptions.addFieldToDocument(String, String, org.apache.lucene.document.Document)` over manually building your Field objects and adding them to the Document.
    `Field.Store` | `getStore()` Prefer the use of `LuceneOptions.addFieldToDocument(String, String, org.apache.lucene.document.Document)` over manually building your Field objects and adding them to the Document.
    `Field.TermVector` | `getTermVector()` Prefer the use of `LuceneOptions.addFieldToDocument(String, String, org.apache.lucene.document.Document)` over manually building your Field objects and adding them to the Document.
    `String` | `indexNullAs()`
    `boolean` | `isCompressed()` Prefer the use of `LuceneOptions.addFieldToDocument(String, String, org.apache.lucene.document.Document)` over manually building your Field objects and adding them to the Document.

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

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

- - ### Constructor Detail

    - #### LuceneOptionsImpl

          public LuceneOptionsImpl(DocumentFieldMetadata fieldMetadata,
                                   float fieldLevelBoost,
                                   float inheritedBoost)

    - #### LuceneOptionsImpl

          public LuceneOptionsImpl(Field.Index indexMode,
                                   Field.TermVector termVector,
                                   Store store,
                                   String indexNullAs,
                                   float fieldLevelBoost,
                                   float inheritedBoost)

  - ### Method Detail

    - #### addFieldToDocument

          public void addFieldToDocument(String name,
                                         String indexedString,
                                         Document document)

      Description copied from interface: `LuceneOptions`
      Add a new field with the name `fieldName` to the Lucene Document `document` using the value `indexedString`. If the indexedString is null then the field is not added to the document. The field options are following the user declaration:
      - stored or not
      - compressed or not
      - what type of indexing strategy
      - what type of term vector strategy
      Specified by:
        `addFieldToDocument` in interface `LuceneOptions`
      Parameters:
        `name` - The field name
        `indexedString` - The value to index
        `document` - the document to which to add the new field

    - #### getBoost

          @Deprecated
          public float getBoost()

      Deprecated.
      Description copied from interface: `LuceneOptions`
      Prefer the use of `LuceneOptions.addFieldToDocument(String, String, org.apache.lucene.document.Document)` over manually building your Field objects and adding them to the Document.
      Specified by:
        `getBoost` in interface `LuceneOptions`
      Returns:
        Returns the boost factor declared by the user

    - #### indexNullAs

          public String indexNullAs()

      Specified by:
        `indexNullAs` in interface `LuceneOptions`
      Returns:
        Returns the string for indexing `null` values. `null` is returned in case no null token has been specified.

    - #### isCompressed

          public boolean isCompressed()

      Description copied from interface: `LuceneOptions`
      Prefer the use of `LuceneOptions.addFieldToDocument(String, String, org.apache.lucene.document.Document)` over manually building your Field objects and adding them to the Document. To use compression either use #addFieldToDocument or refer to Lucene documentation to implement your own compression strategy.
      Specified by:
        `isCompressed` in interface `LuceneOptions`
      Returns:
        the compression strategy declared by the user `true` if the field value is compressed, `false` otherwise.

    - #### getIndex

          public Field.Index getIndex()

      Description copied from interface: `LuceneOptions`
      Prefer the use of `LuceneOptions.addFieldToDocument(String, String, org.apache.lucene.document.Document)` over manually building your Field objects and adding them to the Document.
      Specified by:
        `getIndex` in interface `LuceneOptions`
      Returns:
        Returns the indexing strategy declared by the user

    - #### getStore

          public Field.Store getStore()

      Description copied from interface: `LuceneOptions`
      Prefer the use of `LuceneOptions.addFieldToDocument(String, String, org.apache.lucene.document.Document)` over manually building your Field objects and adding them to the Document. `org.apache.lucene.document.Field.Store.YES` if the field is stored `org.apache.lucene.document.Field.Store.NO` otherwise. To determine if the field must be compressed, use `LuceneOptions.isCompressed()`. Starting from version 3.3, Store.COMPRESS is no longer returned, use `LuceneOptions.isCompressed()` To use compression either use #addFieldToDocument or refer to Lucene documentation to implement your own compression strategy.
      Specified by:
        `getStore` in interface `LuceneOptions`
      Returns:
        Returns the store strategy declared by the user

    - #### getTermVector

          public Field.TermVector getTermVector()

      Description copied from interface: `LuceneOptions`
      Prefer the use of `LuceneOptions.addFieldToDocument(String, String, org.apache.lucene.document.Document)` over manually building your Field objects and adding them to the Document.
      Specified by:
        `getTermVector` in interface `LuceneOptions`
      Returns:
        Returns the term vector strategy declared by the user

    - #### addDoubleFieldToDocument

          public void addDoubleFieldToDocument(String fieldName,
                                               double doubleValue,
                                               Document document)

    - #### addFloatFieldToDocument

          public void addFloatFieldToDocument(String fieldName,
                                              float floatValue,
                                              Document document)

    - #### addIntFieldToDocument

          public void addIntFieldToDocument(String fieldName,
                                            int intValue,
                                            Document document)

    - #### addLongFieldToDocument

          public void addLongFieldToDocument(String fieldName,
                                             long longValue,
                                             Document document)

    - #### addNumericFieldToDocument

          public void addNumericFieldToDocument(String fieldName,
                                                Object indexedValue,
                                                Document document)

      Description copied from interface: `LuceneOptions`
      Add a new NumericField with the name `fieldName` to the Lucene Document `document` using the value `numericValue`. If the value is not numeric then the field is not added to the document
      Specified by:
        `addNumericFieldToDocument` in interface `LuceneOptions`
      Parameters:
        `fieldName` - The name of the field
        `indexedValue` - The numeric value, either an Int, Long, Float or Double
        `document` - the document to which to add the new field

    - #### addSortedDocValuesFieldToDocument

          public void addSortedDocValuesFieldToDocument(String fieldName,
                                                        String indexedString,
                                                        Document document)

      Description copied from interface: `LuceneOptions`
      Add a new sorted doc values field with the name `fieldName` to the Lucene Document `document` using the value `indexedString`.

      If the indexedString is null then the field is not added to the document.

      Specified by:
        `addSortedDocValuesFieldToDocument` in interface `LuceneOptions`
      Parameters:
        `fieldName` - The field name
        `indexedString` - The value to index
        `document` - the document to which to add the new field

    - #### addNumericDocValuesFieldToDocument

          public void addNumericDocValuesFieldToDocument(String fieldName,
                                                         Number numericValue,
                                                         Document document)

      Description copied from interface: `LuceneOptions`
      Add a new numeric doc values field with the name `fieldName` to the Lucene Document `document` using the value `numericValue`.

      If the value is not numeric then the field is not added to the document

      Specified by:
        `addNumericDocValuesFieldToDocument` in interface `LuceneOptions`
      Parameters:
        `fieldName` - The name of the field
        `numericValue` - The numeric value, either an Int, Long, Float or Double
        `document` - the document to which to add the new field

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved