public class StoredField extends Field
IndexSearcher.doc(int) and IndexReader.document() will
return the field and its value.Field.Store| Modifier and Type | Field and Description |
|---|---|
static FieldType |
TYPE
Type for a stored-only field.
|
fieldsData, name, tokenStream, type| Modifier | Constructor and Description |
|---|---|
|
StoredField(java.lang.String name,
byte[] value)
Create a stored-only field with the given binary value.
|
|
StoredField(java.lang.String name,
byte[] value,
int offset,
int length)
Create a stored-only field with the given binary value.
|
|
StoredField(java.lang.String name,
BytesRef value)
Create a stored-only field with the given binary value.
|
|
StoredField(java.lang.String name,
BytesRef bytes,
FieldType type)
Expert: allows you to customize the
FieldType. |
|
StoredField(java.lang.String name,
java.lang.CharSequence value,
FieldType type)
Expert: allows you to customize the
FieldType. |
|
StoredField(java.lang.String name,
double value)
Create a stored-only field with the given double value.
|
protected |
StoredField(java.lang.String name,
FieldType type)
Expert: allows you to customize the
FieldType. |
|
StoredField(java.lang.String name,
float value)
Create a stored-only field with the given float value.
|
|
StoredField(java.lang.String name,
int value)
Create a stored-only field with the given integer value.
|
|
StoredField(java.lang.String name,
long value)
Create a stored-only field with the given long value.
|
|
StoredField(java.lang.String name,
java.lang.String value)
Create a stored-only field with the given string value.
|
|
StoredField(java.lang.String name,
java.lang.String value,
FieldType type)
Expert: allows you to customize the
FieldType. |
binaryValue, fieldType, getCharSequenceValue, name, numericValue, readerValue, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setStringValue, setTokenStream, stringValue, tokenStream, tokenStreamValue, toStringpublic static final FieldType TYPE
protected StoredField(java.lang.String name,
FieldType type)
FieldType.name - field nametype - custom FieldType for this fieldjava.lang.IllegalArgumentException - if the field name or type
is null.public StoredField(java.lang.String name,
BytesRef bytes,
FieldType type)
FieldType.
NOTE: the provided byte[] is not copied so be sure not to change it until you're done with this field.
name - field namebytes - byte array pointing to binary content (not copied)type - custom FieldType for this fieldjava.lang.IllegalArgumentException - if the field name, value or type
is null.public StoredField(java.lang.String name,
byte[] value)
NOTE: the provided byte[] is not copied so be sure not to change it until you're done with this field.
name - field namevalue - byte array pointing to binary content (not copied)java.lang.IllegalArgumentException - if the field name or value
is null.public StoredField(java.lang.String name,
byte[] value,
int offset,
int length)
NOTE: the provided byte[] is not copied so be sure not to change it until you're done with this field.
name - field namevalue - byte array pointing to binary content (not copied)offset - starting position of the byte arraylength - valid length of the byte arrayjava.lang.IllegalArgumentException - if the field name or value
is null.public StoredField(java.lang.String name,
BytesRef value)
NOTE: the provided BytesRef is not copied so be sure not to change it until you're done with this field.
name - field namevalue - BytesRef pointing to binary content (not copied)java.lang.IllegalArgumentException - if the field name or value
is null.public StoredField(java.lang.String name,
java.lang.String value)
name - field namevalue - string valuejava.lang.IllegalArgumentException - if the field name or value
is null.public StoredField(java.lang.String name,
java.lang.String value,
FieldType type)
FieldType.name - field namevalue - string valuetype - custom FieldType for this fieldjava.lang.IllegalArgumentException - if the field name, value or type
is null.public StoredField(java.lang.String name,
java.lang.CharSequence value,
FieldType type)
FieldType.name - field namevalue - CharSequence valuetype - custom FieldType for this fieldjava.lang.IllegalArgumentException - if the field name, value or type
is null.public StoredField(java.lang.String name,
int value)
name - field namevalue - integer valuejava.lang.IllegalArgumentException - if the field name is null.public StoredField(java.lang.String name,
float value)
name - field namevalue - float valuejava.lang.IllegalArgumentException - if the field name is null.public StoredField(java.lang.String name,
long value)
name - field namevalue - long valuejava.lang.IllegalArgumentException - if the field name is null.public StoredField(java.lang.String name,
double value)
name - field namevalue - double valuejava.lang.IllegalArgumentException - if the field name is null.Copyright © 2000–2025 The Apache Software Foundation. All rights reserved.