Method AddField
AddField(String, String, Analyzer)
Convenience method; Tokenizes the given field text and adds the resulting terms to the index; Equivalent to adding an indexed non-keyword Lucene Field that is tokenized, not stored, termVectorStored with positions (or termVectorStored with positions and offsets),
Declaration
public virtual void AddField(string fieldName, string text, Analyzer analyzer)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | a name to be associated with the text |
System.String | text | the text to tokenize and index. |
Analyzer | analyzer | the analyzer to use for tokenization |
AddField(String, TokenStream)
Equivalent to AddField(fieldName, stream, 1.0f)
.
Declaration
public virtual void AddField(string fieldName, TokenStream stream)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | a name to be associated with the text |
TokenStream | stream | the token stream to retrieve tokens from |
AddField(String, TokenStream, Single)
Iterates over the given token stream and adds the resulting terms to the index;
Equivalent to adding a tokenized, indexed, termVectorStored, unstored,
Lucene Field.
Finally closes the token stream. Note that untokenized keywords can be added with this method via
KeywordTokenStream{T}(ICollection{T})"/>, the Lucene KeywordTokenizer
or similar utilities.
Declaration
public virtual void AddField(string fieldName, TokenStream stream, float boost)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | a name to be associated with the text |
TokenStream | stream | the token stream to retrieve tokens from. |
System.Single | boost | the boost factor for hits for this field |
See Also
AddField(String, TokenStream, Single, Int32)
Iterates over the given token stream and adds the resulting terms to the index;
Equivalent to adding a tokenized, indexed, termVectorStored, unstored,
Lucene Field.
Finally closes the token stream. Note that untokenized keywords can be added with this method via
KeywordTokenStream{T}(ICollection{T})"/>, the Lucene KeywordTokenizer
or similar utilities.
Declaration
public virtual void AddField(string fieldName, TokenStream stream, float boost, int positionIncrementGap)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | a name to be associated with the text |
TokenStream | stream | the token stream to retrieve tokens from. |
System.Single | boost | the boost factor for hits for this field |
System.Int32 | positionIncrementGap | the position increment gap if fields with the same name are added more than once |
See Also
AddField(String, TokenStream, Single, Int32, Int32)
Iterates over the given token stream and adds the resulting terms to the index;
Equivalent to adding a tokenized, indexed, termVectorStored, unstored,
Lucene Field.
Finally closes the token stream. Note that untokenized keywords can be added with this method via
KeywordTokenStream{T}(ICollection{T})"/>, the Lucene KeywordTokenizer
or similar utilities.
Declaration
public virtual void AddField(string fieldName, TokenStream stream, float boost, int positionIncrementGap, int offsetGap)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | a name to be associated with the text |
TokenStream | stream | the token stream to retrieve tokens from. |
System.Single | boost | the boost factor for hits for this field |
System.Int32 | positionIncrementGap | the position increment gap if fields with the same name are added more than once |
System.Int32 | offsetGap | the offset gap if fields with the same name are added more than once |