Lucene.Net  3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties
Public Member Functions | Properties | List of all members
Lucene.Net.Documents.IFieldable Interface Reference

Synonymous with Field. More...

Inherited by Lucene.Net.Documents.AbstractField, and Lucene.Net.Documents.Field.

Public Member Functions

byte[] GetBinaryValue ()
 Return the raw byte[] for the binary field. Note that you must also call BinaryLength and BinaryOffset to know which range of bytes in this returned array belong to the field.
 
byte[] GetBinaryValue (byte[] result)
 Return the raw byte[] for the binary field. Note that you must also call BinaryLength and BinaryOffset to know which range of bytes in this returned array belong to the field.About reuse: if you pass in the result byte[] and it is used, likely the underlying implementation will hold onto this byte[] and return it in future calls to GetBinaryValue() or GetBinaryValue(). So if you subsequently re-use the same byte[] elsewhere it will alter this Fieldable's value.
 

Properties

float Boost [get, set]
 Gets or sets the boost factor for hits for this field. This value will be multiplied into the score of all hits on this this field of this document.
 
string Name [get]
 Returns the name of the field as an interned string. For example "date", "title", "body", ...
 
string StringValue [get]
 The value of the field as a String, or null. For indexing, if isStored()==true, the stringValue() will be used as the stored field value unless isBinary()==true, in which case GetBinaryValue() will be used.
 
TextReader ReaderValue [get]
 The value of the field as a Reader, which can be used at index time to generate indexed tokens.
 
TokenStream TokenStreamValue [get]
 The TokenStream for this field to be used when indexing, or null.
 
bool IsStored [get]
 True if the value of the field is to be stored in the index for return with search hits.
 
bool IsIndexed [get]
 True if the value of the field is to be indexed, so that it may be searched on.
 
bool IsTokenized [get]
 True if the value of the field should be tokenized as text prior to indexing. Un-tokenized fields are indexed as a single word and may not be Reader-valued.
 
bool IsTermVectorStored [get]
 True if the term or terms used to index this field are stored as a term vector, available from Lucene.Net.Index.IndexReader.GetTermFreqVector(int,String). These methods do not provide access to the original content of the field, only to terms used to index it. If the original content must be preserved, use the stored attribute instead.
 
bool IsStoreOffsetWithTermVector [get]
 True if terms are stored as term vector together with their offsets (start and end positon in source text).
 
bool IsStorePositionWithTermVector [get]
 True if terms are stored as term vector together with their token positions.
 
bool IsBinary [get]
 True if the value of the field is stored as binary
 
bool OmitNorms [get, set]
 True if norms are omitted for this indexed field.
 
bool IsLazy [get]
 Indicates whether a Field is Lazy or not. The semantics of Lazy loading are such that if a Field is lazily loaded, retrieving it's values via StringValue() or GetBinaryValue() is only valid as long as the Lucene.Net.Index.IndexReader that retrieved the Document is still open.
 
int BinaryOffset [get]
 Returns offset into byte[] segment that is used as value, if Field is not binary returned value is undefined
 
int BinaryLength [get]
 Returns length of byte[] segment that is used as value, if Field is not binary returned value is undefined
 
bool OmitTermFreqAndPositions [get, set]
 

Detailed Description

Synonymous with Field.

<bold>WARNING</bold>: This interface may change within minor versions, despite Lucene's backward compatibility requirements. This means new methods may be added from version to version. This change only affects the Fieldable API; other backwards compatibility promises remain intact. For example, Lucene can still read and write indices created within the same major version.

Definition at line 35 of file Fieldable.cs.

Member Function Documentation

byte [] Lucene.Net.Documents.IFieldable.GetBinaryValue ( )

Return the raw byte[] for the binary field. Note that you must also call BinaryLength and BinaryOffset to know which range of bytes in this returned array belong to the field.

Returns
reference to the Field value as byte[].

Implemented in Lucene.Net.Documents.AbstractField.

byte [] Lucene.Net.Documents.IFieldable.GetBinaryValue ( byte[]  result)

Return the raw byte[] for the binary field. Note that you must also call BinaryLength and BinaryOffset to know which range of bytes in this returned array belong to the field.About reuse: if you pass in the result byte[] and it is used, likely the underlying implementation will hold onto this byte[] and return it in future calls to GetBinaryValue() or GetBinaryValue(). So if you subsequently re-use the same byte[] elsewhere it will alter this Fieldable's value.

Parameters
resultUser defined buffer that will be used if possible. If this is null or not large enough, a new buffer is allocated
Returns
reference to the Field value as byte[].

Implemented in Lucene.Net.Documents.NumericField, and Lucene.Net.Documents.AbstractField.

Property Documentation

int Lucene.Net.Documents.IFieldable.BinaryLength
get

Returns length of byte[] segment that is used as value, if Field is not binary returned value is undefined

length of byte[] segment that represents this Field value

Definition at line 161 of file Fieldable.cs.

int Lucene.Net.Documents.IFieldable.BinaryOffset
get

Returns offset into byte[] segment that is used as value, if Field is not binary returned value is undefined

index of the first character in byte[] segment that represents this Field value

Definition at line 155 of file Fieldable.cs.

float Lucene.Net.Documents.IFieldable.Boost
getset

Gets or sets the boost factor for hits for this field. This value will be multiplied into the score of all hits on this this field of this document.

The boost is multiplied by Lucene.Net.Documents.Document.Boost of the document containing this field. If a document has multiple fields with the same name, all such values are multiplied together. This product is then used to compute the norm factor for the field. By default, in the Lucene.Net.Search.Similarity.ComputeNorm(String,Lucene.Net.Index.FieldInvertState) method, the boost value is multiplied by the Lucene.Net.Search.Similarity.LengthNorm(String,int) and then rounded by Lucene.Net.Search.Similarity.EncodeNorm(float) before it is stored in the index. One should attempt to ensure that this product does not overflow the range of that encoding.

The default value is 1.0.

Note: this value is not stored directly with the document in the index. Documents returned from Lucene.Net.Index.IndexReader.Document(int) and Lucene.Net.Search.Searcher.Doc(int) may thus not have the same value present as when this field was indexed.

See Also
Lucene.Net.Documents.Document.Boost
See Also
Lucene.Net.Search.Similarity.ComputeNorm(String, FieldInvertState)
See Also
Lucene.Net.Search.Similarity.EncodeNorm(float)

Definition at line 66 of file Fieldable.cs.

bool Lucene.Net.Documents.IFieldable.IsBinary
get

True if the value of the field is stored as binary

Definition at line 130 of file Fieldable.cs.

bool Lucene.Net.Documents.IFieldable.IsIndexed
get

True if the value of the field is to be indexed, so that it may be searched on.

Definition at line 102 of file Fieldable.cs.

bool Lucene.Net.Documents.IFieldable.IsLazy
get

Indicates whether a Field is Lazy or not. The semantics of Lazy loading are such that if a Field is lazily loaded, retrieving it's values via StringValue() or GetBinaryValue() is only valid as long as the Lucene.Net.Index.IndexReader that retrieved the Document is still open.

true if this field can be loaded lazily

Definition at line 149 of file Fieldable.cs.

bool Lucene.Net.Documents.IFieldable.IsStored
get

True if the value of the field is to be stored in the index for return with search hits.

Definition at line 97 of file Fieldable.cs.

bool Lucene.Net.Documents.IFieldable.IsStoreOffsetWithTermVector
get

True if terms are stored as term vector together with their offsets (start and end positon in source text).

Definition at line 124 of file Fieldable.cs.

bool Lucene.Net.Documents.IFieldable.IsStorePositionWithTermVector
get

True if terms are stored as term vector together with their token positions.

Definition at line 127 of file Fieldable.cs.

bool Lucene.Net.Documents.IFieldable.IsTermVectorStored
get

True if the term or terms used to index this field are stored as a term vector, available from Lucene.Net.Index.IndexReader.GetTermFreqVector(int,String). These methods do not provide access to the original content of the field, only to terms used to index it. If the original content must be preserved, use the stored attribute instead.

See Also
Lucene.Net.Index.IndexReader.GetTermFreqVector(int, String)

Definition at line 119 of file Fieldable.cs.

bool Lucene.Net.Documents.IFieldable.IsTokenized
get

True if the value of the field should be tokenized as text prior to indexing. Un-tokenized fields are indexed as a single word and may not be Reader-valued.

Definition at line 108 of file Fieldable.cs.

string Lucene.Net.Documents.IFieldable.Name
get

Returns the name of the field as an interned string. For example "date", "title", "body", ...

Definition at line 71 of file Fieldable.cs.

bool Lucene.Net.Documents.IFieldable.OmitNorms
getset

True if norms are omitted for this indexed field.

Expert: If set, omit normalization factors associated with this indexed field. This effectively disables indexing boosts and length normalization for this field.

Definition at line 140 of file Fieldable.cs.

bool Lucene.Net.Documents.IFieldable.OmitTermFreqAndPositions
getset

Expert:

If set, omit term freq, positions and payloads from postings for this field.

NOTE: While this option reduces storage space required in the index, it also means any query requiring positional information, such as Lucene.Net.Search.PhraseQuery or Lucene.Net.Search.Spans.SpanQuery subclasses will silently fail to find results.

Definition at line 203 of file Fieldable.cs.

TextReader Lucene.Net.Documents.IFieldable.ReaderValue
get

The value of the field as a Reader, which can be used at index time to generate indexed tokens.

See Also
StringValue()

Definition at line 87 of file Fieldable.cs.

string Lucene.Net.Documents.IFieldable.StringValue
get

The value of the field as a String, or null. For indexing, if isStored()==true, the stringValue() will be used as the stored field value unless isBinary()==true, in which case GetBinaryValue() will be used.

If isIndexed()==true and isTokenized()==false, this String value will be indexed as a single token. If isIndexed()==true and isTokenized()==true, then tokenStreamValue() will be used to generate indexed tokens if not null, else readerValue() will be used to generate indexed tokens if not null, else stringValue() will be used to generate tokens.

Definition at line 82 of file Fieldable.cs.

TokenStream Lucene.Net.Documents.IFieldable.TokenStreamValue
get

The TokenStream for this field to be used when indexing, or null.

See Also
StringValue()

Definition at line 92 of file Fieldable.cs.


The documentation for this interface was generated from the following file: