public final class StoredField extends Field
IndexSearcher.doc(int)
and IndexReader.document(int, org.apache.lucene.index.StoredFieldVisitor)
will
return the field and its value.Field.Index, Field.Store, Field.TermVector
Modifier and Type | Field and Description |
---|---|
static FieldType |
TYPE
Type for a stored-only field.
|
boost, fieldsData, name, tokenStream, type
Constructor and Description |
---|
StoredField(String name,
byte[] value)
Create a stored-only field with the given binary value.
|
StoredField(String name,
byte[] value,
int offset,
int length)
Create a stored-only field with the given binary value.
|
StoredField(String name,
BytesRef value)
Create a stored-only field with the given binary value.
|
StoredField(String name,
double value)
Create a stored-only field with the given double value.
|
StoredField(String name,
float value)
Create a stored-only field with the given float value.
|
StoredField(String name,
int value)
Create a stored-only field with the given integer value.
|
StoredField(String name,
long value)
Create a stored-only field with the given long value.
|
StoredField(String name,
String value)
Create a stored-only field with the given string value.
|
binaryValue, boost, fieldType, name, numericValue, readerValue, setBoost, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setStringValue, setTokenStream, stringValue, tokenStream, tokenStreamValue, toString, translateFieldType
public static final FieldType TYPE
public StoredField(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)IllegalArgumentException
- if the field name is null.public StoredField(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 arrayIllegalArgumentException
- if the field name is null.public StoredField(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)IllegalArgumentException
- if the field name is null.public StoredField(String name, String value)
name
- field namevalue
- string valueIllegalArgumentException
- if the field name or value is null.public StoredField(String name, int value)
name
- field namevalue
- integer valueIllegalArgumentException
- if the field name is null.public StoredField(String name, float value)
name
- field namevalue
- float valueIllegalArgumentException
- if the field name is null.public StoredField(String name, long value)
name
- field namevalue
- long valueIllegalArgumentException
- if the field name is null.public StoredField(String name, double value)
name
- field namevalue
- double valueIllegalArgumentException
- if the field name is null.Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.