org.hibernate.search.engine.impl
Class LuceneOptionsImpl

java.lang.Object
  extended by 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
LuceneOptionsImpl(DocumentFieldMetadata fieldMetadata)
           
LuceneOptionsImpl(DocumentFieldMetadata fieldMetadata, float boost)
           
 
Method Summary
 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 addNumericFieldToDocument(String fieldName, Object value, Document document)
          Add a new NumericField with the name fieldName to the Lucene Document document using the value numericValue.
 float getBoost()
          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.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)

LuceneOptionsImpl

public LuceneOptionsImpl(DocumentFieldMetadata fieldMetadata,
                         float boost)
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:

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

addNumericFieldToDocument

public void addNumericFieldToDocument(String fieldName,
                                      Object value,
                                      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
value - The numeric value, either an Int, Long, Float or Double
document - the document to which to add the the new field

getBoost

public float getBoost()
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


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