Field
Expert: directly create a field for a document. Most users should use one of the sugar subclasses:
StringField: String indexed verbatim as a single token
IntField:
intindexed for exact/range queries.LongField:
longindexed for exact/range queries.FloatField:
floatindexed for exact/range queries.DoubleField:
doubleindexed for exact/range queries.SortedDocValuesField:
byte[]indexed column-wise for sorting/facetingSortedSetDocValuesField:
SortedSet<byte[]>indexed column-wise for sorting/facetingNumericDocValuesField:
longindexed column-wise for sorting/facetingSortedNumericDocValuesField:
SortedSet<long>indexed column-wise for sorting/facetingStoredField: Stored-only value for retrieving in summary results
A field is a section of a Document. Each field has three parts: name, type and value. Values may be text (String, Reader or pre-analyzed TokenStream), binary (byte[]), or numeric (a Number). Fields are optionally stored in the index, so that they may be returned with hits on the document.
NOTE: the field type is an IndexableFieldType. Making changes to the state of the IndexableFieldType will impact any Field it is used in. It is strongly recommended that no changes be made after Field instantiation.
Inheritors
Constructors
Functions
Non-null if this field has a binary value
Returns the FieldType for this field.
Describes how this field should be inverted. This must return a non-null value if the field indexes terms and postings.
Non-null if this field has a numeric value
The value of the field as a Reader, or null. If null, the String value or binary value is used. Exactly one of stringValue(), readerValue(), and binaryValue() must be set.
Expert: change the value of this field. See .setStringValue.
Expert: change the value of this field. See .setStringValue.
Expert: change the value of this field. See .setStringValue.
Expert: change the value of this field. See .setStringValue.
Expert: change the value of this field. See .setStringValue.
Expert: change the value of this field. See .setStringValue.
Expert: change the value of this field. See .setStringValue.
Expert: change the value of this field. See .setStringValue.
Expert: change the value of this field. This can be used during indexing to re-use a single Field instance to improve indexing speed by avoiding GC cost of new'ing and reclaiming Field instances. Typically a single Document instance is re-used as well. This helps most on small documents.
Expert: sets the token stream to be used for indexing.
Stored value. This method is called to populate stored fields and must return a non-null value if the field stored.
The value of the field as a String, or null. If null, the Reader value or binary value is used. Exactly one of stringValue(), readerValue(), and binaryValue() must be set.
Creates the TokenStream used for indexing this field. If appropriate, implementations should use the given Analyzer to create the TokenStreams.
The TokenStream for this field to be used when indexing, or null. If null, the Reader value or String value is analyzed to produce the indexed tokens.