public interface LuceneOptions
addFieldToDocument(String, String, org.apache.lucene.document.Document)
or addNumericFieldToDocument(String, Object, org.apache.lucene.document.Document)
as all the options declared by
the user are transparently carried over. Compression is also provided transparently.
String fieldValue = convertToString(value);
luceneOptions.addFieldToDocument(name, fieldValue, document);
// Numeric
Double aDouble = ...
luceneOptions.addNumericFieldToDocument(name, value, document);
Modifier and Type | Method and Description |
---|---|
void |
addFieldToDocument(String fieldName,
String indexedString,
Document document)
Add a new field with the name
fieldName to the Lucene Document document using the value
indexedString . |
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 numericValue,
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
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
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
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
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
addFieldToDocument(String, String, org.apache.lucene.document.Document)
over manually building your Field objects and adding them to the Document. |
void addFieldToDocument(String fieldName, String indexedString, Document document)
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:
fieldName
- The field nameindexedString
- The value to indexdocument
- the document to which to add the new fieldvoid addNumericFieldToDocument(String fieldName, Object numericValue, Document document)
fieldName
to the Lucene Document document
using the value numericValue
. If the value is not numeric then the field is not added to the documentfieldName
- The name of the fieldnumericValue
- The numeric value, either an Int, Long, Float or Doubledocument
- the document to which to add the new fieldvoid addSortedDocValuesFieldToDocument(String fieldName, String indexedString, Document document)
fieldName
to the Lucene Document
document
using the value indexedString
.
If the indexedString is null then the field is not added to the document.
fieldName
- The field nameindexedString
- The value to indexdocument
- the document to which to add the new fieldvoid addNumericDocValuesFieldToDocument(String fieldName, Number numericValue, Document document)
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
fieldName
- The name of the fieldnumericValue
- The numeric value, either an Int, Long, Float or Doubledocument
- the document to which to add the new fieldboolean isCompressed()
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.true
if the field value is compressed, false
otherwise.Field.Store getStore()
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 isCompressed()
.
Starting from version 3.3, Store.COMPRESS is no longer returned, use isCompressed()
To use compression either use #addFieldToDocument or refer
to Lucene documentation to implement your own compression
strategy.Field.Index getIndex()
addFieldToDocument(String, String, org.apache.lucene.document.Document)
over manually building your Field objects and adding them to the Document.Field.TermVector getTermVector()
addFieldToDocument(String, String, org.apache.lucene.document.Document)
over manually building your Field objects and adding them to the Document.float getBoost()
addFieldToDocument(String, String, org.apache.lucene.document.Document)
over manually building your Field objects and adding them to the Document.String indexNullAs()
null
values. null
is returned in case no null token has
been specified.Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved