public class LuceneOptionsImpl extends Object implements LuceneOptions
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) |
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()
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. |
public LuceneOptionsImpl(DocumentFieldMetadata fieldMetadata, float fieldLevelBoost, float inheritedBoost)
public LuceneOptionsImpl(Field.Index indexMode, Field.TermVector termVector, Store store, String indexNullAs, float fieldLevelBoost, float inheritedBoost)
public void addFieldToDocument(String name, String indexedString, Document document)
LuceneOptions
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:
addFieldToDocument
in interface LuceneOptions
name
- The field nameindexedString
- The value to indexdocument
- the document to which to add the new fieldpublic float getBoost()
LuceneOptions
LuceneOptions.addFieldToDocument(String, String, org.apache.lucene.document.Document)
over manually building your Field objects and adding them to the Document.getBoost
in interface LuceneOptions
public String indexNullAs()
indexNullAs
in interface LuceneOptions
null
values. null
is returned in case no null token has
been specified.public boolean isCompressed()
LuceneOptions
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.isCompressed
in interface LuceneOptions
true
if the field value is compressed, false
otherwise.public Field.Index getIndex()
LuceneOptions
LuceneOptions.addFieldToDocument(String, String, org.apache.lucene.document.Document)
over manually building your Field objects and adding them to the Document.getIndex
in interface LuceneOptions
public Field.Store getStore()
LuceneOptions
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.getStore
in interface LuceneOptions
public Field.TermVector getTermVector()
LuceneOptions
LuceneOptions.addFieldToDocument(String, String, org.apache.lucene.document.Document)
over manually building your Field objects and adding them to the Document.getTermVector
in interface LuceneOptions
public void addDoubleFieldToDocument(String fieldName, double doubleValue, Document document)
public void addFloatFieldToDocument(String fieldName, float floatValue, Document document)
public void addIntFieldToDocument(String fieldName, int intValue, Document document)
public void addLongFieldToDocument(String fieldName, long longValue, Document document)
public void addNumericFieldToDocument(String fieldName, Object indexedValue, Document document)
LuceneOptions
fieldName
to the Lucene Document document
using the value numericValue
. If the value is not numeric then the field is not added to the documentaddNumericFieldToDocument
in interface LuceneOptions
fieldName
- The name of the fieldindexedValue
- The numeric value, either an Int, Long, Float or Doubledocument
- the document to which to add the new fieldpublic void addSortedDocValuesFieldToDocument(String fieldName, String indexedString, Document document)
LuceneOptions
fieldName
to the Lucene Document
document
using the value indexedString
.
If the indexedString is null then the field is not added to the document.
addSortedDocValuesFieldToDocument
in interface LuceneOptions
fieldName
- The field nameindexedString
- The value to indexdocument
- the document to which to add the new fieldpublic void addNumericDocValuesFieldToDocument(String fieldName, Number numericValue, Document document)
LuceneOptions
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
addNumericDocValuesFieldToDocument
in interface LuceneOptions
fieldName
- The name of the fieldnumericValue
- The numeric value, either an Int, Long, Float or Doubledocument
- the document to which to add the new fieldCopyright © 2006-2017 Red Hat, Inc. All Rights Reserved