org.apache.lucene.document
public final class Field extends AbstractField implements Fieldable, Serializable
Nested Class Summary | |
---|---|
static class | Field.Index Specifies whether and how a field should be indexed. |
static class | Field.Store Specifies whether and how a field should be stored. |
static class | Field.TermVector Specifies whether and how a field should have term vectors. |
Constructor Summary | |
---|---|
Field(String name, String value, Field.Store store, Field.Index index)
Create a field by specifying its name, value and how it will
be saved in the index. | |
Field(String name, String value, Field.Store store, Field.Index index, Field.TermVector termVector)
Create a field by specifying its name, value and how it will
be saved in the index.
| |
Field(String name, Reader reader)
Create a tokenized and indexed field that is not stored. | |
Field(String name, Reader reader, Field.TermVector termVector)
Create a tokenized and indexed field that is not stored, optionally with
storing term vectors. | |
Field(String name, TokenStream tokenStream)
Create a tokenized and indexed field that is not stored. | |
Field(String name, TokenStream tokenStream, Field.TermVector termVector)
Create a tokenized and indexed field that is not stored, optionally with
storing term vectors. | |
Field(String name, byte[] value, Field.Store store)
Create a stored field with binary value. |
Method Summary | |
---|---|
byte[] | binaryValue() The value of the field in Binary, or null. |
Reader | readerValue() The value of the field as a Reader, or null. |
String | stringValue() The value of the field as a String, or null. |
TokenStream | tokenStreamValue() The value of the field as a TokesStream, or null. |
Parameters: name The name of the field value The string to process store Whether value
should be stored in the index index Whether the field should be indexed, and if so, if it should
be tokenized before indexing
Throws: NullPointerException if name or value is null
IllegalArgumentException if the field is neither stored nor indexed
Parameters: name The name of the field value The string to process store Whether value
should be stored in the index index Whether the field should be indexed, and if so, if it should
be tokenized before indexing termVector Whether term vector should be stored
Throws: NullPointerException if name or value is null
IllegalArgumentException in any of the following situations:
TermVector.YES
Parameters: name The name of the field reader The reader with the content
Throws: NullPointerException if name or reader is null
Parameters: name The name of the field reader The reader with the content termVector Whether term vector should be stored
Throws: NullPointerException if name or reader is null
Parameters: name The name of the field tokenStream The TokenStream with the content
Throws: NullPointerException if name or tokenStream is null
Parameters: name The name of the field tokenStream The TokenStream with the content termVector Whether term vector should be stored
Throws: NullPointerException if name or tokenStream is null
Parameters: name The name of the field value The binary value store How value
should be stored (compressed or not)
Throws: IllegalArgumentException if store is Store.NO