Class Field
A field is a section of a Document. Each field has two parts, a name and a value. Values may be free text, provided as a String or as a Reader, or they may be atomic keywords, which are not further processed. Such keywords may be used to represent dates, urls, etc. Fields are optionally stored in the index, so that they may be returned with hits on the document.
Inherited Members
Namespace:
Assembly: Lucene.Net.NetCore.dll
Syntax
public sealed class Field : AbstractField, IFieldable
Constructors
Name | Description |
---|---|
Field(String, TokenStream) | Create a tokenized and indexed field that is not stored. Term vectors will not be stored. This is useful for pre-analyzed fields. The TokenStream is read only when the Document is added to the index, i.e. you may not close the TokenStream until AddDocument(Document) has been called. |
Field(String, TokenStream, Field.TermVector) | Create a tokenized and indexed field that is not stored, optionally with storing term vectors. This is useful for pre-analyzed fields. The TokenStream is read only when the Document is added to the index, i.e. you may not close the TokenStream until AddDocument(Document) has been called. |
Field(String, Boolean, String, Field.Store, Field.Index, Field.TermVector) | Create a field by specifying its name, value and how it will be saved in the index. |
Field(String, Byte[], Field.Store) | Create a stored field with binary value. Optionally the value may be compressed. |
Field(String, Byte[], Int32, Int32, Field.Store) | Create a stored field with binary value. Optionally the value may be compressed. |
Field(String, IO.TextReader) | Create a tokenized and indexed field that is not stored. Term vectors will not be stored. The Reader is read only when the Document is added to the index, i.e. you may not close the Reader until AddDocument(Document) has been called. |
Field(String, IO.TextReader, Field.TermVector) | Create a tokenized and indexed field that is not stored, optionally with storing term vectors. The Reader is read only when the Document is added to the index, i.e. you may not close the Reader until AddDocument(Document) has been called. |
Field(String, String, Field.Store, Field.Index) | Create a field by specifying its name, value and how it will be saved in the index. Term vectors will not be stored in the index. |
Field(String, String, Field.Store, Field.Index, Field.TermVector) | Create a field by specifying its name, value and how it will be saved in the index. |
Properties
Name | Description |
---|---|
ReaderValue | 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 getBinaryValue() must be set. |
StringValue | 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 getBinaryValue() must be set. |
TokenStreamValue | The TokesStream 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. |
Methods
Name | Description |
---|---|
SetTokenStream(TokenStream) | Expert: sets the token stream to be used for indexing and causes isIndexed() and isTokenized() to return true. May be combined with stored values from stringValue() or GetBinaryValue() |
SetValue(Byte[]) | Expert: change the value of this field. See setValue(String). |
SetValue(Byte[], Int32, Int32) | Expert: change the value of this field. See setValue(String). |
SetValue(IO.TextReader) | Expert: change the value of this field. See setValue(String). |
SetValue(String) | 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.
Each Field instance should only be used once within a single Document instance. See ImproveIndexingSpeed for details.
|