public final class StringField extends Field
SortedDocValuesField
to your document.Field.Store
Modifier and Type | Field and Description |
---|---|
static FieldType |
TYPE_NOT_STORED
Indexed, not tokenized, omits norms, indexes
DOCS_ONLY, not stored.
|
static FieldType |
TYPE_STORED
Indexed, not tokenized, omits norms, indexes
DOCS_ONLY, stored
|
fieldsData, name, tokenStream, type
Constructor and Description |
---|
StringField(String name,
BytesRef value,
Field.Store stored)
Creates a new binary StringField, indexing the provided binary (BytesRef)
value as a single token.
|
StringField(String name,
String value,
Field.Store stored)
Creates a new textual StringField, indexing the provided String value
as a single token.
|
binaryValue, fieldType, getCharSequenceValue, name, numericValue, readerValue, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setStringValue, setTokenStream, stringValue, tokenStream, tokenStreamValue, toString
public static final FieldType TYPE_NOT_STORED
public static final FieldType TYPE_STORED
public StringField(String name, String value, Field.Store stored)
name
- field namevalue
- String valuestored
- Store.YES if the content should also be storedIllegalArgumentException
- if the field name or value is null.public StringField(String name, BytesRef value, Field.Store stored)
name
- field namevalue
- BytesRef value. The provided value is not cloned so
you must not change it until the document(s) holding it
have been indexed.stored
- Store.YES if the content should also be storedIllegalArgumentException
- if the field name or value is null.Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.