Lucene.Net.Highlight

Highlighter.Net 2.0.0

Lucene.Net.Highlight Namespace

Namespace hierarchy

Classes

Class | Description
DefaultEncoder | Simple {@link Encoder} implementation that does not modify the output
GradientFormatter | Formats text with different color intensity depending on the score of the term.
Highlighter | Class used to markup highlighted terms found in the best sections of a text, using configurable {@link Fragmenter}, {@link Scorer}, {@link Formatter}, {@link Encoder} and tokenizers.
NullFragmenter | {@link Fragmenter} implementation which does not fragment the text. This is useful for highlighting the entire content of a document or field.
QueryScorer | {@link Scorer} implementation which scores text fragments by the number of unique query terms found. This class uses the {@link QueryTermExtractor} class to process determine the query terms and their boosts to be used.
QueryTermExtractor | Utility class used to extract the terms used in a query, plus any weights. This class will not find terms for MultiTermQuery, RangeQuery and PrefixQuery classes so the caller must pass a rewritten query (see Query.rewrite) to obtain a list of expanded terms.
SimpleFragmenter | {@link Fragmenter} implementation which breaks text up into same-size fragments with no concerns over spotting sentence boundaries.
SimpleHTMLEncoder | Simple {@link Encoder} implementation to escape text for HTML output
SimpleHTMLFormatter | Simple {@link Formatter} implementation to highlight terms with a pre and post tag
SpanGradientFormatter | Formats text with different color intensity depending on the score of the term using the span tag. GradientFormatter uses a bgcolor argument to the font tag which doesn't work in Mozilla, thus this class.
TextFragment | Low-level class used to record information about a section of a document with a score.
TokenGroup | One, or several overlapping tokens, along with the score(s) and the scope of the original text
TokenSources | Hides implementation issues associated with obtaining a TokenStream for use with the higlighter - can obtain from TermFreqVectors with offsets and (optionally) positions or from Analyzer class reparsing the stored content.
TokenSources.StoredTokenStream |
WeightedTerm | Lightweight class to hold term and a weight value used for scoring this term

Interfaces

Interface | Description
Encoder | Encodes original text. The Encoder works with the Formatter to generate the output.
Formatter | Processes terms found in the original text, typically by applying some form of mark-up to highlight terms in HTML search results pages.
Fragmenter | Implements the policy for breaking text into multiple fragments for consideration by the {@link Highlighter} class. A sophisticated implementation may do this on the basis of detecting end of sentences in the text.
Scorer | Adds to the score for a fragment based on its tokens


DefaultEncoder Class

Simple {@link Encoder} implementation that does not modify the output

For a list of all members of this type, see DefaultEncoder Members.

System.Object
Lucene.Net.Highlight.DefaultEncoder

public class DefaultEncoder : Encoder

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

DefaultEncoder Members | Lucene.Net.Highlight Namespace


DefaultEncoder Members

DefaultEncoder overview

Public Instance Constructors

DefaultEncoder Constructor Initializes a new instance of the DefaultEncoder class.

Public Instance Methods

EncodeText |
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

DefaultEncoder Class | Lucene.Net.Highlight Namespace


DefaultEncoder Constructor

Initializes a new instance of the DefaultEncoder class.

public DefaultEncoder();

See Also

DefaultEncoder Class | Lucene.Net.Highlight Namespace


DefaultEncoder Methods

The methods of the DefaultEncoder class are listed below. For a complete list of DefaultEncoder class members, see the DefaultEncoder Members topic.

Public Instance Methods

EncodeText |
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

DefaultEncoder Class | Lucene.Net.Highlight Namespace


DefaultEncoder.EncodeText Method

public virtual string EncodeText(
string originalText
);

Implements

Encoder.EncodeText

See Also

DefaultEncoder Class | Lucene.Net.Highlight Namespace


Encoder Interface

Encodes original text. The Encoder works with the Formatter to generate the output.

For a list of all members of this type, see Encoder Members.

public interface Encoder

Types that implement Encoder

Type | Description
DefaultEncoder | Simple {@link Encoder} implementation that does not modify the output
SimpleHTMLEncoder | Simple {@link Encoder} implementation to escape text for HTML output

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

Encoder Members | Lucene.Net.Highlight Namespace


Encoder Members

Encoder overview

Public Instance Methods

EncodeText

See Also

Encoder Interface | Lucene.Net.Highlight Namespace


Encoder Methods

The methods of the Encoder interface are listed below. For a complete list of Encoder interface members, see the Encoder Members topic.

Public Instance Methods

EncodeText

See Also

Encoder Interface | Lucene.Net.Highlight Namespace


Encoder.EncodeText Method

string EncodeText(
string originalText
);

Parameters

originalText
The section of text being output

See Also

Encoder Interface | Lucene.Net.Highlight Namespace


Formatter Interface

Processes terms found in the original text, typically by applying some form of mark-up to highlight terms in HTML search results pages.

For a list of all members of this type, see Formatter Members.

public interface Formatter

Types that implement Formatter

Type | Description
GradientFormatter | Formats text with different color intensity depending on the score of the term.
SimpleHTMLFormatter | Simple {@link Formatter} implementation to highlight terms with a pre and post tag
SpanGradientFormatter | Formats text with different color intensity depending on the score of the term using the span tag. GradientFormatter uses a bgcolor argument to the font tag which doesn't work in Mozilla, thus this class.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

Formatter Members | Lucene.Net.Highlight Namespace


Formatter Members

Formatter overview

Public Instance Methods

HighlightTerm

See Also

Formatter Interface | Lucene.Net.Highlight Namespace


Formatter Methods

The methods of the Formatter interface are listed below. For a complete list of Formatter interface members, see the Formatter Members topic.

Public Instance Methods

HighlightTerm

See Also

Formatter Interface | Lucene.Net.Highlight Namespace


Formatter.HighlightTerm Method

string HighlightTerm(
string originalText,
TokenGroup tokenGroup
);

Parameters

originalText
The section of text being considered for markup
tokenGroup
contains one or several overlapping Tokens along with their scores and positions.

See Also

Formatter Interface | Lucene.Net.Highlight Namespace


Fragmenter Interface

Implements the policy for breaking text into multiple fragments for consideration by the {@link Highlighter} class. A sophisticated implementation may do this on the basis of detecting end of sentences in the text.

For a list of all members of this type, see Fragmenter Members.

public interface Fragmenter

Types that implement Fragmenter

Type | Description
NullFragmenter | {@link Fragmenter} implementation which does not fragment the text. This is useful for highlighting the entire content of a document or field.
SimpleFragmenter | {@link Fragmenter} implementation which breaks text up into same-size fragments with no concerns over spotting sentence boundaries.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

Fragmenter Members | Lucene.Net.Highlight Namespace


Fragmenter Members

Fragmenter overview

Public Instance Methods

IsNewFragment | Test to see if this token from the stream should be held in a new TextFragment
Start | Initializes the Fragmenter

See Also

Fragmenter Interface | Lucene.Net.Highlight Namespace


Fragmenter Methods

The methods of the Fragmenter interface are listed below. For a complete list of Fragmenter interface members, see the Fragmenter Members topic.

Public Instance Methods

IsNewFragment | Test to see if this token from the stream should be held in a new TextFragment
Start | Initializes the Fragmenter

See Also

Fragmenter Interface | Lucene.Net.Highlight Namespace


Fragmenter.IsNewFragment Method

Test to see if this token from the stream should be held in a new TextFragment

bool IsNewFragment(
Token nextToken
);

Parameters

nextToken

See Also

Fragmenter Interface | Lucene.Net.Highlight Namespace


Fragmenter.Start Method

Initializes the Fragmenter

void Start(
string originalText
);

Parameters

originalText

See Also

Fragmenter Interface | Lucene.Net.Highlight Namespace


GradientFormatter Class

Formats text with different color intensity depending on the score of the term.

For a list of all members of this type, see GradientFormatter Members.

System.Object
Lucene.Net.Highlight.GradientFormatter
Lucene.Net.Highlight.SpanGradientFormatter

public class GradientFormatter : Formatter

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

GradientFormatter Members | Lucene.Net.Highlight Namespace


GradientFormatter Members

GradientFormatter overview

Public Static Methods

HexToInt Converts a hex string into an int. Integer.parseInt(hex, 16) assumes the input is nonnegative unless there is a preceding minus sign. This method reads the input as twos complement instead, so if the input is 8 bytes long, it will correctly restore a negative int produced by Integer.toHexString() but not neccesarily one produced by Integer.toString(x,16) since that method will produce a string like '-FF' for negative integer values.

Public Instance Constructors

GradientFormatter Constructor Sets the color range for the IDF scores

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
HighlightTerm |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

Protected Internal Instance Fields

highlightBackground
highlightForeground

Protected Internal Instance Methods

GetBackgroundColorString
GetForegroundColorString

See Also

GradientFormatter Class | Lucene.Net.Highlight Namespace


GradientFormatter Constructor

Sets the color range for the IDF scores

public GradientFormatter(
float maxScore,
string minForegroundColor,
string maxForegroundColor,
string minBackgroundColor,
string maxBackgroundColor
);

Parameters

maxScore
minForegroundColor
maxForegroundColor
minBackgroundColor
maxBackgroundColor

See Also

GradientFormatter Class | Lucene.Net.Highlight Namespace


GradientFormatter Fields

The fields of the GradientFormatter class are listed below. For a complete list of GradientFormatter class members, see the GradientFormatter Members topic.

Protected Internal Instance Fields

highlightBackground
highlightForeground

See Also

GradientFormatter Class | Lucene.Net.Highlight Namespace


GradientFormatter.highlightBackground Field

protected internal bool highlightBackground;

See Also

GradientFormatter Class | Lucene.Net.Highlight Namespace


GradientFormatter.highlightForeground Field

protected internal bool highlightForeground;

See Also

GradientFormatter Class | Lucene.Net.Highlight Namespace


GradientFormatter Methods

The methods of the GradientFormatter class are listed below. For a complete list of GradientFormatter class members, see the GradientFormatter Members topic.

Public Static Methods

HexToInt Converts a hex string into an int. Integer.parseInt(hex, 16) assumes the input is nonnegative unless there is a preceding minus sign. This method reads the input as twos complement instead, so if the input is 8 bytes long, it will correctly restore a negative int produced by Integer.toHexString() but not neccesarily one produced by Integer.toString(x,16) since that method will produce a string like '-FF' for negative integer values.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
HighlightTerm |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

Protected Internal Instance Methods

GetBackgroundColorString
GetForegroundColorString

See Also

GradientFormatter Class | Lucene.Net.Highlight Namespace


GradientFormatter.GetBackgroundColorString Method

protected internal virtual string GetBackgroundColorString(
float score
);

See Also

GradientFormatter Class | Lucene.Net.Highlight Namespace


GradientFormatter.GetForegroundColorString Method

protected internal virtual string GetForegroundColorString(
float score
);

See Also

GradientFormatter Class | Lucene.Net.Highlight Namespace


GradientFormatter.HexToInt Method

Converts a hex string into an int. Integer.parseInt(hex, 16) assumes the input is nonnegative unless there is a preceding minus sign. This method reads the input as twos complement instead, so if the input is 8 bytes long, it will correctly restore a negative int produced by Integer.toHexString() but not neccesarily one produced by Integer.toString(x,16) since that method will produce a string like '-FF' for negative integer values.

public static int HexToInt(
string hex
);

Parameters

hex

See Also

GradientFormatter Class | Lucene.Net.Highlight Namespace


GradientFormatter.HighlightTerm Method

public virtual string HighlightTerm(
string originalText,
TokenGroup tokenGroup
);

Implements

Formatter.HighlightTerm

See Also

GradientFormatter Class | Lucene.Net.Highlight Namespace


Highlighter Class

Class used to markup highlighted terms found in the best sections of a text, using configurable {@link Fragmenter}, {@link Scorer}, {@link Formatter}, {@link Encoder} and tokenizers.

For a list of all members of this type, see Highlighter Members.

System.Object
Lucene.Net.Highlight.Highlighter

public class Highlighter

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

Highlighter Members | Lucene.Net.Highlight Namespace


Highlighter Members

Highlighter overview

Public Static Fields

DEFAULT_MAX_DOC_BYTES_TO_ANALYZE

Public Instance Constructors

Highlighter Overloaded. Initializes a new instance of the Highlighter class.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBestFragment | Overloaded. Highlights chosen terms in a text, extracting the most relevant section. This is a convenience method that calls {@link #GetBestFragment(TokenStream, String)}
GetBestFragments | Overloaded. Highlights chosen terms in a text, extracting the most relevant sections. This is a convenience method that calls {@link #getBestFragments(TokenStream, String, int)}
GetBestTextFragments | Low level api to get the most relevant (formatted) sections of the document. This method has been made public to allow visibility of score information held in TextFragment objects. Thanks to Jason Calabrese for help in redefining the interface.
GetEncoder |
GetFragmentScorer |
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetMaxDocBytesToAnalyze |
GetTextFragmenter |
GetType (inherited from Object) | Gets the Type of the current instance.
SetEncoder |
SetFragmentScorer |
SetMaxDocBytesToAnalyze |
SetTextFragmenter |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Highlighter Class | Lucene.Net.Highlight Namespace


Highlighter Constructor

Overload List

public Highlighter(Formatter,Encoder,Scorer);

public Highlighter(Formatter,Scorer);

public Highlighter(Scorer);

See Also

Highlighter Class | Lucene.Net.Highlight Namespace


Highlighter Constructor (Scorer)

public Highlighter(
Scorer fragmentScorer
);

See Also

Highlighter Class | Lucene.Net.Highlight Namespace | Highlighter Constructor Overload List


Highlighter Constructor (Formatter, Scorer)

public Highlighter(
Formatter formatter,
Scorer fragmentScorer
);

See Also

Highlighter Class | Lucene.Net.Highlight Namespace | Highlighter Constructor Overload List


Highlighter Constructor (Formatter, Encoder, Scorer)

public Highlighter(
Formatter formatter,
Encoder encoder,
Scorer fragmentScorer
);

See Also

Highlighter Class | Lucene.Net.Highlight Namespace | Highlighter Constructor Overload List


Highlighter Fields

The fields of the Highlighter class are listed below. For a complete list of Highlighter class members, see the Highlighter Members topic.

Public Static Fields

DEFAULT_MAX_DOC_BYTES_TO_ANALYZE

See Also

Highlighter Class | Lucene.Net.Highlight Namespace


Highlighter.DEFAULT_MAX_DOC_BYTES_TO_ANALYZE Field

public const int DEFAULT_MAX_DOC_BYTES_TO_ANALYZE = 51200;

See Also

Highlighter Class | Lucene.Net.Highlight Namespace


Highlighter Methods

The methods of the Highlighter class are listed below. For a complete list of Highlighter class members, see the Highlighter Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBestFragment | Overloaded. Highlights chosen terms in a text, extracting the most relevant section. This is a convenience method that calls {@link #GetBestFragment(TokenStream, String)}
GetBestFragments | Overloaded. Highlights chosen terms in a text, extracting the most relevant sections. This is a convenience method that calls {@link #getBestFragments(TokenStream, String, int)}
GetBestTextFragments | Low level api to get the most relevant (formatted) sections of the document. This method has been made public to allow visibility of score information held in TextFragment objects. Thanks to Jason Calabrese for help in redefining the interface.
GetEncoder |
GetFragmentScorer |
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetMaxDocBytesToAnalyze |
GetTextFragmenter |
GetType (inherited from Object) | Gets the Type of the current instance.
SetEncoder |
SetFragmentScorer |
SetMaxDocBytesToAnalyze |
SetTextFragmenter |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Highlighter Class | Lucene.Net.Highlight Namespace


GetBestFragment Method

Highlighter.Net 2.0.0

Highlighter.GetBestFragment Method

Highlights chosen terms in a text, extracting the most relevant section. This is a convenience method that calls {@link #GetBestFragment(TokenStream, String)}

Overload List

Highlights chosen terms in a text, extracting the most relevant section. This is a convenience method that calls {@link #GetBestFragment(TokenStream, String)}

public string GetBestFragment(Analyzer,string,string);

Highlights chosen terms in a text, extracting the most relevant section. The document text is analysed in chunks to record hit statistics across the document. After accumulating stats, the fragment with the highest score is returned

public string GetBestFragment(TokenStream,string);

See Also

Highlighter Class | Lucene.Net.Highlight Namespace


Highlighter.GetBestFragment Method (Analyzer, String, String)

Highlights chosen terms in a text, extracting the most relevant section. This is a convenience method that calls {@link #GetBestFragment(TokenStream, String)}

public string GetBestFragment(
Analyzer analyzer,
string fieldName,
string text
);

Parameters

analyzer
the analyzer that will be used to split
text
into chunks
fieldName
Name of field used to influence analyzer's tokenization policy
text
text to highlight terms in

Return Value

highlighted text fragment or null if no terms found

See Also

Highlighter Class | Lucene.Net.Highlight Namespace | Highlighter.GetBestFragment Overload List


Highlighter.GetBestFragment Method (TokenStream, String)

Highlights chosen terms in a text, extracting the most relevant section. The document text is analysed in chunks to record hit statistics across the document. After accumulating stats, the fragment with the highest score is returned

public string GetBestFragment(
TokenStream tokenStream,
string text
);

Parameters

tokenStream
a stream of tokens identified in the text parameter, including offset information. This is typically produced by an analyzer re-parsing a document's text. Some work may be done on retrieving TokenStreams more efficently by adding support for storing original text position data in the Lucene index but this support is not currently available (as of Lucene 1.4 rc2).
text
text to highlight terms in

Return Value

highlighted text fragment or null if no terms found

See Also

Highlighter Class | Lucene.Net.Highlight Namespace | Highlighter.GetBestFragment Overload List


GetBestFragments Method

Highlighter.Net 2.0.0

Highlighter.GetBestFragments Method

Highlights chosen terms in a text, extracting the most relevant sections. This is a convenience method that calls {@link #getBestFragments(TokenStream, String, int)}

Overload List

Highlights chosen terms in a text, extracting the most relevant sections. This is a convenience method that calls {@link #getBestFragments(TokenStream, String, int)}

public string[] GetBestFragments(Analyzer,string,int);

Highlights chosen terms in a text, extracting the most relevant sections. This is a convenience method that calls {@link #getBestFragments(TokenStream, String, int)}

public string[] GetBestFragments(Analyzer,string,string,int);

Highlights chosen terms in a text, extracting the most relevant sections. The document text is analysed in chunks to record hit statistics across the document. After accumulating stats, the fragments with the highest scores are returned as an array of strings in order of score (contiguous fragments are merged into one in their original order to improve readability)

public string[] GetBestFragments(TokenStream,string,int);

Highlights terms in the text , extracting the most relevant sections and concatenating the chosen fragments with a separator (typically "..."). The document text is analysed in chunks to record hit statistics across the document. After accumulating stats, the fragments with the highest scores are returned in order as "separator" delimited strings.

public string GetBestFragments(TokenStream,string,int,string);

See Also

Highlighter Class | Lucene.Net.Highlight Namespace


Highlighter.GetBestFragments Method (Analyzer, String, Int32)

Highlights chosen terms in a text, extracting the most relevant sections. This is a convenience method that calls {@link #getBestFragments(TokenStream, String, int)}

public string[] GetBestFragments(
Analyzer analyzer,
string text,
int maxNumFragments
);

Parameters

analyzer
the analyzer that will be used to split
text
into chunks
text
text to highlight terms in
maxNumFragments
the maximum number of fragments.

Return Value

highlighted text fragments (between 0 and maxNumFragments number of fragments)

See Also

Highlighter Class | Lucene.Net.Highlight Namespace | Highlighter.GetBestFragments Overload List


Highlighter.GetBestFragments Method (Analyzer, String, String, Int32)

Highlights chosen terms in a text, extracting the most relevant sections. This is a convenience method that calls {@link #getBestFragments(TokenStream, String, int)}

public string[] GetBestFragments(
Analyzer analyzer,
string fieldName,
string text,
int maxNumFragments
);

Parameters

analyzer
the analyzer that will be used to split
text
into chunks
fieldName
the name of the field being highlighted (used by analyzer)
text
text to highlight terms in
maxNumFragments
the maximum number of fragments.

Return Value

highlighted text fragments (between 0 and maxNumFragments number of fragments)

See Also

Highlighter Class | Lucene.Net.Highlight Namespace | Highlighter.GetBestFragments Overload List


Highlighter.GetBestFragments Method (TokenStream, String, Int32)

Highlights chosen terms in a text, extracting the most relevant sections. The document text is analysed in chunks to record hit statistics across the document. After accumulating stats, the fragments with the highest scores are returned as an array of strings in order of score (contiguous fragments are merged into one in their original order to improve readability)

public string[] GetBestFragments(
TokenStream tokenStream,
string text,
int maxNumFragments
);

Parameters

tokenStream
text
text to highlight terms in
maxNumFragments
the maximum number of fragments.

Return Value

highlighted text fragments (between 0 and maxNumFragments number of fragments)

See Also

Highlighter Class | Lucene.Net.Highlight Namespace | Highlighter.GetBestFragments Overload List


Highlighter.GetBestFragments Method (TokenStream, String, Int32, String)

Highlights terms in the text , extracting the most relevant sections and concatenating the chosen fragments with a separator (typically "..."). The document text is analysed in chunks to record hit statistics across the document. After accumulating stats, the fragments with the highest scores are returned in order as "separator" delimited strings.

public string GetBestFragments(
TokenStream tokenStream,
string text,
int maxNumFragments,
string separator
);

Parameters

tokenStream
text
text to highlight terms in
maxNumFragments
the maximum number of fragments.
separator
the separator used to intersperse the document fragments (typically "...")

Return Value

highlighted text

See Also

Highlighter Class | Lucene.Net.Highlight Namespace | Highlighter.GetBestFragments Overload List


Highlighter.GetBestTextFragments Method

Low level api to get the most relevant (formatted) sections of the document. This method has been made public to allow visibility of score information held in TextFragment objects. Thanks to Jason Calabrese for help in redefining the interface.

public TextFragment[] GetBestTextFragments(
TokenStream tokenStream,
string text,
bool mergeContiguousFragments,
int maxNumFragments
);

Parameters

tokenStream
text
mergeContiguousFragments
maxNumFragments

See Also

Highlighter Class | Lucene.Net.Highlight Namespace


Highlighter.GetEncoder Method

public virtual Encoder GetEncoder();

See Also

Highlighter Class | Lucene.Net.Highlight Namespace


Highlighter.GetFragmentScorer Method

public virtual Scorer GetFragmentScorer();

Return Value

Object used to score each text fragment

See Also

Highlighter Class | Lucene.Net.Highlight Namespace


Highlighter.GetMaxDocBytesToAnalyze Method

public virtual int GetMaxDocBytesToAnalyze();

Return Value

the maximum number of bytes to be tokenized per doc

See Also

Highlighter Class | Lucene.Net.Highlight Namespace


Highlighter.GetTextFragmenter Method

public virtual Fragmenter GetTextFragmenter();

See Also

Highlighter Class | Lucene.Net.Highlight Namespace


Highlighter.SetEncoder Method

public virtual void SetEncoder(
Encoder encoder
);

See Also

Highlighter Class | Lucene.Net.Highlight Namespace


Highlighter.SetFragmentScorer Method

public virtual void SetFragmentScorer(
Scorer scorer
);

Parameters

scorer

See Also

Highlighter Class | Lucene.Net.Highlight Namespace


Highlighter.SetMaxDocBytesToAnalyze Method

public virtual void SetMaxDocBytesToAnalyze(
int byteCount
);

Parameters

byteCount
the maximum number of bytes to be tokenized per doc (This can improve performance with large documents)

See Also

Highlighter Class | Lucene.Net.Highlight Namespace


Highlighter.SetTextFragmenter Method

public virtual void SetTextFragmenter(
Fragmenter fragmenter
);

Parameters

fragmenter

See Also

Highlighter Class | Lucene.Net.Highlight Namespace


NullFragmenter Class

{@link Fragmenter} implementation which does not fragment the text. This is useful for highlighting the entire content of a document or field.

For a list of all members of this type, see NullFragmenter Members.

System.Object
Lucene.Net.Highlight.NullFragmenter

public class NullFragmenter : Fragmenter

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

NullFragmenter Members | Lucene.Net.Highlight Namespace


NullFragmenter Members

NullFragmenter overview

Public Instance Constructors

NullFragmenter Constructor Initializes a new instance of the NullFragmenter class.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
IsNewFragment |
Start |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

NullFragmenter Class | Lucene.Net.Highlight Namespace


NullFragmenter Constructor

Initializes a new instance of the NullFragmenter class.

public NullFragmenter();

See Also

NullFragmenter Class | Lucene.Net.Highlight Namespace


NullFragmenter Methods

The methods of the NullFragmenter class are listed below. For a complete list of NullFragmenter class members, see the NullFragmenter Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
IsNewFragment |
Start |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

NullFragmenter Class | Lucene.Net.Highlight Namespace


NullFragmenter.IsNewFragment Method

public virtual bool IsNewFragment(
Token token
);

Implements

Fragmenter.IsNewFragment

See Also

NullFragmenter Class | Lucene.Net.Highlight Namespace


NullFragmenter.Start Method

public virtual void Start(
string s
);

Implements

Fragmenter.Start

See Also

NullFragmenter Class | Lucene.Net.Highlight Namespace


QueryScorer Class

{@link Scorer} implementation which scores text fragments by the number of unique query terms found. This class uses the {@link QueryTermExtractor} class to process determine the query terms and their boosts to be used.

For a list of all members of this type, see QueryScorer Members.

System.Object
Lucene.Net.Highlight.QueryScorer

public class QueryScorer : Scorer

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

QueryScorer Members | Lucene.Net.Highlight Namespace


QueryScorer Members

QueryScorer overview

Public Instance Constructors

QueryScorer Overloaded. Initializes a new instance of the QueryScorer class.

Public Instance Methods

AllFragmentsProcessed |
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetFragmentScore |
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetMaxTermWeight |
GetTokenScore |
GetType (inherited from Object) | Gets the Type of the current instance.
StartFragment |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

QueryScorer Class | Lucene.Net.Highlight Namespace


QueryScorer Constructor

Overload List

public QueryScorer(WeightedTerm[]);

public QueryScorer(Query);

public QueryScorer(Query,IndexReader,string);

public QueryScorer(Query,string);

See Also

QueryScorer Class | Lucene.Net.Highlight Namespace


QueryScorer Constructor (Query)

public QueryScorer(
Query query
);

Parameters

query
a Lucene query (ideally rewritten using query.rewrite before being passed to this class and the searcher)

See Also

QueryScorer Class | Lucene.Net.Highlight Namespace | QueryScorer Constructor Overload List


QueryScorer Constructor (Query, String)

public QueryScorer(
Query query,
string fieldName
);

Parameters

query
a Lucene query (ideally rewritten using query.rewrite before being passed to this class and the searcher)
fieldName
the Field name which is used to match Query terms

See Also

QueryScorer Class | Lucene.Net.Highlight Namespace | QueryScorer Constructor Overload List


QueryScorer Constructor (Query, IndexReader, String)

public QueryScorer(
Query query,
IndexReader reader,
string fieldName
);

Parameters

query
a Lucene query (ideally rewritten using query.rewrite before being passed to this class and the searcher)
reader
used to compute IDF which can be used to a) score selected fragments better b) use graded highlights eg set font color intensity
fieldName
the field on which Inverse Document Frequency (IDF) calculations are based

See Also

QueryScorer Class | Lucene.Net.Highlight Namespace | QueryScorer Constructor Overload List


QueryScorer Constructor (WeightedTerm[])

public QueryScorer(
WeightedTerm[] weightedTerms
);

See Also

QueryScorer Class | Lucene.Net.Highlight Namespace | QueryScorer Constructor Overload List


QueryScorer Methods

The methods of the QueryScorer class are listed below. For a complete list of QueryScorer class members, see the QueryScorer Members topic.

Public Instance Methods

AllFragmentsProcessed |
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetFragmentScore |
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetMaxTermWeight |
GetTokenScore |
GetType (inherited from Object) | Gets the Type of the current instance.
StartFragment |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

QueryScorer Class | Lucene.Net.Highlight Namespace


QueryScorer.AllFragmentsProcessed Method

public virtual void AllFragmentsProcessed();

See Also

QueryScorer Class | Lucene.Net.Highlight Namespace


QueryScorer.GetFragmentScore Method

public virtual float GetFragmentScore();

Implements

Scorer.GetFragmentScore

See Also

QueryScorer Class | Lucene.Net.Highlight Namespace


QueryScorer.GetMaxTermWeight Method

public virtual float GetMaxTermWeight();

Return Value

The highest weighted term (useful for passing to GradientFormatter to set top end of coloring scale.

See Also

QueryScorer Class | Lucene.Net.Highlight Namespace


QueryScorer.GetTokenScore Method

public virtual float GetTokenScore(
Token token
);

Implements

Scorer.GetTokenScore

See Also

QueryScorer Class | Lucene.Net.Highlight Namespace


QueryScorer.StartFragment Method

public virtual void StartFragment(
TextFragment newFragment
);

Implements

Scorer.StartFragment

See Also

QueryScorer Class | Lucene.Net.Highlight Namespace


QueryTermExtractor Class

Utility class used to extract the terms used in a query, plus any weights. This class will not find terms for MultiTermQuery, RangeQuery and PrefixQuery classes so the caller must pass a rewritten query (see Query.rewrite) to obtain a list of expanded terms.

For a list of all members of this type, see QueryTermExtractor Members.

System.Object
Lucene.Net.Highlight.QueryTermExtractor

public sealed class QueryTermExtractor

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

QueryTermExtractor Members | Lucene.Net.Highlight Namespace


QueryTermExtractor Members

QueryTermExtractor overview

Public Static Methods

GetIdfWeightedTerms | Extracts all terms texts of a given Query into an array of WeightedTerms
GetTerms | Overloaded. Extracts all terms texts of a given Query into an array of WeightedTerms

Public Instance Constructors

QueryTermExtractor Constructor Initializes a new instance of the QueryTermExtractor class.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

See Also

QueryTermExtractor Class | Lucene.Net.Highlight Namespace


QueryTermExtractor Constructor

Initializes a new instance of the QueryTermExtractor class.

public QueryTermExtractor();

See Also

QueryTermExtractor Class | Lucene.Net.Highlight Namespace


QueryTermExtractor Methods

The methods of the QueryTermExtractor class are listed below. For a complete list of QueryTermExtractor class members, see the QueryTermExtractor Members topic.

Public Static Methods

GetIdfWeightedTerms | Extracts all terms texts of a given Query into an array of WeightedTerms
GetTerms | Overloaded. Extracts all terms texts of a given Query into an array of WeightedTerms

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

See Also

QueryTermExtractor Class | Lucene.Net.Highlight Namespace


QueryTermExtractor.GetIdfWeightedTerms Method

Extracts all terms texts of a given Query into an array of WeightedTerms

public static WeightedTerm[] GetIdfWeightedTerms(
Query query,
IndexReader reader,
string fieldName
);

Parameters

query
Query to extract term texts from
reader
used to compute IDF which can be used to a) score selected fragments better b) use graded highlights eg chaning intensity of font color
fieldName
the field on which Inverse Document Frequency (IDF) calculations are based

Return Value

an array of the terms used in a query, plus their weights.

See Also

QueryTermExtractor Class | Lucene.Net.Highlight Namespace


GetTerms Method

Highlighter.Net 2.0.0

QueryTermExtractor.GetTerms Method

Extracts all terms texts of a given Query into an array of WeightedTerms

Overload List

Extracts all terms texts of a given Query into an array of WeightedTerms

public static WeightedTerm[] GetTerms(Query);

Extracts all terms texts of a given Query into an array of WeightedTerms

public static WeightedTerm[] GetTerms(Query,bool);

Extracts all terms texts of a given Query into an array of WeightedTerms

public static WeightedTerm[] GetTerms(Query,bool,string);

See Also

QueryTermExtractor Class | Lucene.Net.Highlight Namespace


QueryTermExtractor.GetTerms Method (Query)

Extracts all terms texts of a given Query into an array of WeightedTerms

public static WeightedTerm[] GetTerms(
Query query
);

Parameters

query
Query to extract term texts from

Return Value

an array of the terms used in a query, plus their weights.

See Also

QueryTermExtractor Class | Lucene.Net.Highlight Namespace | QueryTermExtractor.GetTerms Overload List


QueryTermExtractor.GetTerms Method (Query, Boolean)

Extracts all terms texts of a given Query into an array of WeightedTerms

public static WeightedTerm[] GetTerms(
Query query,
bool prohibited
);

Parameters

query
Query to extract term texts from
prohibited
true
to extract "prohibited" terms, too

Return Value

an array of the terms used in a query, plus their weights.

See Also

QueryTermExtractor Class | Lucene.Net.Highlight Namespace | QueryTermExtractor.GetTerms Overload List


QueryTermExtractor.GetTerms Method (Query, Boolean, String)

Extracts all terms texts of a given Query into an array of WeightedTerms

public static WeightedTerm[] GetTerms(
Query query,
bool prohibited,
string fieldName
);

Parameters

query
Query to extract term texts from
prohibited
true
to extract "prohibited" terms, too
fieldName
The fieldName used to filter query terms

Return Value

an array of the terms used in a query, plus their weights.

See Also

QueryTermExtractor Class | Lucene.Net.Highlight Namespace | QueryTermExtractor.GetTerms Overload List


Scorer Interface

Adds to the score for a fragment based on its tokens

For a list of all members of this type, see Scorer Members.

public interface Scorer

Types that implement Scorer

Type | Description
QueryScorer | {@link Scorer} implementation which scores text fragments by the number of unique query terms found. This class uses the {@link QueryTermExtractor} class to process determine the query terms and their boosts to be used.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

Scorer Members | Lucene.Net.Highlight Namespace


Scorer Members

Scorer overview

Public Instance Methods

GetFragmentScore | Called when the highlighter has no more tokens for the current fragment - the scorer returns the weighting it has derived for the most recent fragment, typically based on the tokens passed to getTokenScore().
GetTokenScore | Called for each token in the current fragment
StartFragment | called when a new fragment is started for consideration

See Also

Scorer Interface | Lucene.Net.Highlight Namespace


Scorer Methods

The methods of the Scorer interface are listed below. For a complete list of Scorer interface members, see the Scorer Members topic.

Public Instance Methods

GetFragmentScore | Called when the highlighter has no more tokens for the current fragment - the scorer returns the weighting it has derived for the most recent fragment, typically based on the tokens passed to getTokenScore().
GetTokenScore | Called for each token in the current fragment
StartFragment | called when a new fragment is started for consideration

See Also

Scorer Interface | Lucene.Net.Highlight Namespace


Scorer.GetFragmentScore Method

Called when the highlighter has no more tokens for the current fragment - the scorer returns the weighting it has derived for the most recent fragment, typically based on the tokens passed to getTokenScore().

float GetFragmentScore();

See Also

Scorer Interface | Lucene.Net.Highlight Namespace


Scorer.GetTokenScore Method

Called for each token in the current fragment

float GetTokenScore(
Token token
);

Parameters

token
The token to be scored

Return Value

a score which is passed to the Highlighter class to influence the mark-up of the text (this return value is NOT used to score the fragment)

See Also

Scorer Interface | Lucene.Net.Highlight Namespace


Scorer.StartFragment Method

called when a new fragment is started for consideration

void StartFragment(
TextFragment newFragment
);

Parameters

newFragment

See Also

Scorer Interface | Lucene.Net.Highlight Namespace


SimpleFragmenter Class

{@link Fragmenter} implementation which breaks text up into same-size fragments with no concerns over spotting sentence boundaries.

For a list of all members of this type, see SimpleFragmenter Members.

System.Object
Lucene.Net.Highlight.SimpleFragmenter

public class SimpleFragmenter : Fragmenter

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

SimpleFragmenter Members | Lucene.Net.Highlight Namespace


SimpleFragmenter Members

SimpleFragmenter overview

Public Instance Constructors

SimpleFragmenter Overloaded. Initializes a new instance of the SimpleFragmenter class.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetFragmentSize |
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
IsNewFragment |
SetFragmentSize |
Start |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SimpleFragmenter Class | Lucene.Net.Highlight Namespace


SimpleFragmenter Constructor

Initializes a new instance of the SimpleFragmenter class.

Overload List

Initializes a new instance of the SimpleFragmenter class.

public SimpleFragmenter();

public SimpleFragmenter(int);

See Also

SimpleFragmenter Class | Lucene.Net.Highlight Namespace


SimpleFragmenter Constructor ()

Initializes a new instance of the SimpleFragmenter class.

public SimpleFragmenter();

See Also

SimpleFragmenter Class | Lucene.Net.Highlight Namespace | SimpleFragmenter Constructor Overload List


SimpleFragmenter Constructor (Int32)

public SimpleFragmenter(
int fragmentSize
);

Parameters

fragmentSize
size in bytes of each fragment

See Also

SimpleFragmenter Class | Lucene.Net.Highlight Namespace | SimpleFragmenter Constructor Overload List


SimpleFragmenter Methods

The methods of the SimpleFragmenter class are listed below. For a complete list of SimpleFragmenter class members, see the SimpleFragmenter Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetFragmentSize |
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
IsNewFragment |
SetFragmentSize |
Start |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SimpleFragmenter Class | Lucene.Net.Highlight Namespace


SimpleFragmenter.GetFragmentSize Method

public virtual int GetFragmentSize();

Return Value

size in bytes of each fragment

See Also

SimpleFragmenter Class | Lucene.Net.Highlight Namespace


SimpleFragmenter.IsNewFragment Method

public virtual bool IsNewFragment(
Token token
);

Implements

Fragmenter.IsNewFragment

See Also

SimpleFragmenter Class | Lucene.Net.Highlight Namespace


SimpleFragmenter.SetFragmentSize Method

public virtual void SetFragmentSize(
int size
);

Parameters

size
size in bytes of each fragment

See Also

SimpleFragmenter Class | Lucene.Net.Highlight Namespace


SimpleFragmenter.Start Method

public virtual void Start(
string originalText
);

Implements

Fragmenter.Start

See Also

SimpleFragmenter Class | Lucene.Net.Highlight Namespace


SimpleHTMLEncoder Class

Simple {@link Encoder} implementation to escape text for HTML output

For a list of all members of this type, see SimpleHTMLEncoder Members.

System.Object
Lucene.Net.Highlight.SimpleHTMLEncoder

public class SimpleHTMLEncoder : Encoder

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

SimpleHTMLEncoder Members | Lucene.Net.Highlight Namespace


SimpleHTMLEncoder Members

SimpleHTMLEncoder overview

Public Static Methods

HtmlEncode Encode string into HTML

Public Instance Constructors

SimpleHTMLEncoder Constructor Initializes a new instance of the SimpleHTMLEncoder class.

Public Instance Methods

EncodeText |
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SimpleHTMLEncoder Class | Lucene.Net.Highlight Namespace


SimpleHTMLEncoder Constructor

Initializes a new instance of the SimpleHTMLEncoder class.

public SimpleHTMLEncoder();

See Also

SimpleHTMLEncoder Class | Lucene.Net.Highlight Namespace


SimpleHTMLEncoder Methods

The methods of the SimpleHTMLEncoder class are listed below. For a complete list of SimpleHTMLEncoder class members, see the SimpleHTMLEncoder Members topic.

Public Static Methods

HtmlEncode Encode string into HTML

Public Instance Methods

EncodeText |
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SimpleHTMLEncoder Class | Lucene.Net.Highlight Namespace


SimpleHTMLEncoder.EncodeText Method

public virtual string EncodeText(
string originalText
);

Implements

Encoder.EncodeText

See Also

SimpleHTMLEncoder Class | Lucene.Net.Highlight Namespace


SimpleHTMLEncoder.HtmlEncode Method

Encode string into HTML

public static string HtmlEncode(
string plainText
);

See Also

SimpleHTMLEncoder Class | Lucene.Net.Highlight Namespace


SimpleHTMLFormatter Class

Simple {@link Formatter} implementation to highlight terms with a pre and post tag

For a list of all members of this type, see SimpleHTMLFormatter Members.

System.Object
Lucene.Net.Highlight.SimpleHTMLFormatter

public class SimpleHTMLFormatter : Formatter

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

SimpleHTMLFormatter Members | Lucene.Net.Highlight Namespace


SimpleHTMLFormatter Members

SimpleHTMLFormatter overview

Public Instance Constructors

SimpleHTMLFormatter Overloaded. Initializes a new instance of the SimpleHTMLFormatter class.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
HighlightTerm |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SimpleHTMLFormatter Class | Lucene.Net.Highlight Namespace


SimpleHTMLFormatter Constructor

Overload List

Default constructor uses HTML: <B> tags to markup terms

public SimpleHTMLFormatter();

public SimpleHTMLFormatter(string,string);

See Also

SimpleHTMLFormatter Class | Lucene.Net.Highlight Namespace


SimpleHTMLFormatter Constructor (String, String)

public SimpleHTMLFormatter(
string preTag,
string postTag
);

See Also

SimpleHTMLFormatter Class | Lucene.Net.Highlight Namespace | SimpleHTMLFormatter Constructor Overload List


SimpleHTMLFormatter Constructor ()

Default constructor uses HTML: <B> tags to markup terms

public SimpleHTMLFormatter();

See Also

SimpleHTMLFormatter Class | Lucene.Net.Highlight Namespace | SimpleHTMLFormatter Constructor Overload List


SimpleHTMLFormatter Methods

The methods of the SimpleHTMLFormatter class are listed below. For a complete list of SimpleHTMLFormatter class members, see the SimpleHTMLFormatter Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
HighlightTerm |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

SimpleHTMLFormatter Class | Lucene.Net.Highlight Namespace


SimpleHTMLFormatter.HighlightTerm Method

public virtual string HighlightTerm(
string originalText,
TokenGroup tokenGroup
);

Implements

Formatter.HighlightTerm

See Also

SimpleHTMLFormatter Class | Lucene.Net.Highlight Namespace


SpanGradientFormatter Class

Formats text with different color intensity depending on the score of the term using the span tag. GradientFormatter uses a bgcolor argument to the font tag which doesn't work in Mozilla, thus this class.

For a list of all members of this type, see SpanGradientFormatter Members.

System.Object
Lucene.Net.Highlight.GradientFormatter
Lucene.Net.Highlight.SpanGradientFormatter

public class SpanGradientFormatter : GradientFormatter

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

SpanGradientFormatter Members | Lucene.Net.Highlight Namespace |


SpanGradientFormatter Members

SpanGradientFormatter overview

Public Instance Constructors

SpanGradientFormatter Constructor

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
HighlightTerm |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

Protected Internal Instance Fields

highlightBackground (inherited from GradientFormatter)
highlightForeground (inherited from GradientFormatter)

Protected Internal Instance Methods

GetBackgroundColorString (inherited from GradientFormatter)
GetForegroundColorString (inherited from GradientFormatter)

See Also

SpanGradientFormatter Class | Lucene.Net.Highlight Namespace |


SpanGradientFormatter Constructor

public SpanGradientFormatter(
float maxScore,
string minForegroundColor,
string maxForegroundColor,
string minBackgroundColor,
string maxBackgroundColor
);

See Also

SpanGradientFormatter Class | Lucene.Net.Highlight Namespace


SpanGradientFormatter Methods

The methods of the SpanGradientFormatter class are listed below. For a complete list of SpanGradientFormatter class members, see the SpanGradientFormatter Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
HighlightTerm |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

Protected Internal Instance Methods

GetBackgroundColorString (inherited from GradientFormatter)
GetForegroundColorString (inherited from GradientFormatter)

See Also

SpanGradientFormatter Class | Lucene.Net.Highlight Namespace |


SpanGradientFormatter.HighlightTerm Method

public override string HighlightTerm(
string originalText,
TokenGroup tokenGroup
);

Implements

Formatter.HighlightTerm

See Also

SpanGradientFormatter Class | Lucene.Net.Highlight Namespace


TextFragment Class

Low-level class used to record information about a section of a document with a score.

For a list of all members of this type, see TextFragment Members.

System.Object
Lucene.Net.Highlight.TextFragment

public class TextFragment

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

TextFragment Members | Lucene.Net.Highlight Namespace


TextFragment Members

TextFragment overview

Public Instance Constructors

TextFragment Constructor

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Follows |
GetFragNum |
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetScore |
GetType (inherited from Object) | Gets the Type of the current instance.
Merge |
ToString |

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TextFragment Class | Lucene.Net.Highlight Namespace


TextFragment Constructor

public TextFragment(
StringBuilder markedUpText,
int textStartPos,
int fragNum
);

See Also

TextFragment Class | Lucene.Net.Highlight Namespace


TextFragment Methods

The methods of the TextFragment class are listed below. For a complete list of TextFragment class members, see the TextFragment Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Follows |
GetFragNum |
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetScore |
GetType (inherited from Object) | Gets the Type of the current instance.
Merge |
ToString |

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TextFragment Class | Lucene.Net.Highlight Namespace


TextFragment.Follows Method

public virtual bool Follows(
TextFragment fragment
);

Parameters

fragment

Return Value

true if this fragment follows the one passed

See Also

TextFragment Class | Lucene.Net.Highlight Namespace


TextFragment.GetFragNum Method

public virtual int GetFragNum();

Return Value

the fragment sequence number

See Also

TextFragment Class | Lucene.Net.Highlight Namespace


TextFragment.GetScore Method

public virtual float GetScore();

See Also

TextFragment Class | Lucene.Net.Highlight Namespace


TextFragment.Merge Method

public virtual void Merge(
TextFragment frag2
);

Parameters

frag2
Fragment to be merged into this one

See Also

TextFragment Class | Lucene.Net.Highlight Namespace


TextFragment.ToString Method

public override string ToString();

See Also

TextFragment Class | Lucene.Net.Highlight Namespace


TokenGroup Class

One, or several overlapping tokens, along with the score(s) and the scope of the original text

For a list of all members of this type, see TokenGroup Members.

System.Object
Lucene.Net.Highlight.TokenGroup

public class TokenGroup

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

TokenGroup Members | Lucene.Net.Highlight Namespace


TokenGroup Members

TokenGroup overview

Public Instance Constructors

TokenGroup Constructor Initializes a new instance of the TokenGroup class.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEndOffset |
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetNumTokens |
GetScore |
GetStartOffset |
GetToken |
GetTotalScore |
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TokenGroup Class | Lucene.Net.Highlight Namespace


TokenGroup Constructor

Initializes a new instance of the TokenGroup class.

public TokenGroup();

See Also

TokenGroup Class | Lucene.Net.Highlight Namespace


TokenGroup Methods

The methods of the TokenGroup class are listed below. For a complete list of TokenGroup class members, see the TokenGroup Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEndOffset |
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetNumTokens |
GetScore |
GetStartOffset |
GetToken |
GetTotalScore |
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TokenGroup Class | Lucene.Net.Highlight Namespace


TokenGroup.GetEndOffset Method

public virtual int GetEndOffset();

Return Value

the end position in the original text

See Also

TokenGroup Class | Lucene.Net.Highlight Namespace


TokenGroup.GetNumTokens Method

public virtual int GetNumTokens();

Return Value

the number of tokens in this group

See Also

TokenGroup Class | Lucene.Net.Highlight Namespace


TokenGroup.GetScore Method

public virtual float GetScore(
int index
);

Parameters

index
a value between 0 and numTokens -1

Return Value

the "n"th score

See Also

TokenGroup Class | Lucene.Net.Highlight Namespace


TokenGroup.GetStartOffset Method

public virtual int GetStartOffset();

Return Value

the start position in the original text

See Also

TokenGroup Class | Lucene.Net.Highlight Namespace


TokenGroup.GetToken Method

public virtual Token GetToken(
int index
);

Parameters

index
a value between 0 and numTokens -1

Return Value

the "n"th token

See Also

TokenGroup Class | Lucene.Net.Highlight Namespace


TokenGroup.GetTotalScore Method

public virtual float GetTotalScore();

Return Value

all tokens' scores summed up

See Also

TokenGroup Class | Lucene.Net.Highlight Namespace


TokenSources Class

Hides implementation issues associated with obtaining a TokenStream for use with the higlighter - can obtain from TermFreqVectors with offsets and (optionally) positions or from Analyzer class reparsing the stored content.

For a list of all members of this type, see TokenSources Members.

System.Object
Lucene.Net.Highlight.TokenSources

public class TokenSources

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

TokenSources Members | Lucene.Net.Highlight Namespace


TokenSources Members

TokenSources overview

Public Static Methods

GetAnyTokenStream | A convenience method that tries a number of approaches to getting a token stream. The cost of finding there are no termVectors in the index is minimal (1000 invocations still registers 0 ms). So this "lazy" (flexible?) approach to coding is probably acceptable
GetTokenStream | Overloaded.

Public Instance Constructors

TokenSources Constructor Initializes a new instance of the TokenSources class.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TokenSources Class | Lucene.Net.Highlight Namespace


TokenSources Constructor

Initializes a new instance of the TokenSources class.

public TokenSources();

See Also

TokenSources Class | Lucene.Net.Highlight Namespace


TokenSources Methods

The methods of the TokenSources class are listed below. For a complete list of TokenSources class members, see the TokenSources Members topic.

Public Static Methods

GetAnyTokenStream | A convenience method that tries a number of approaches to getting a token stream. The cost of finding there are no termVectors in the index is minimal (1000 invocations still registers 0 ms). So this "lazy" (flexible?) approach to coding is probably acceptable
GetTokenStream | Overloaded.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TokenSources Class | Lucene.Net.Highlight Namespace


TokenSources.GetAnyTokenStream Method

A convenience method that tries a number of approaches to getting a token stream. The cost of finding there are no termVectors in the index is minimal (1000 invocations still registers 0 ms). So this "lazy" (flexible?) approach to coding is probably acceptable

public static TokenStream GetAnyTokenStream(
IndexReader reader,
int docId,
string field,
Analyzer analyzer
);

Parameters

reader
docId
field
analyzer

Return Value

null if field not stored correctly

See Also

TokenSources Class | Lucene.Net.Highlight Namespace


GetTokenStream Method

Highlighter.Net 2.0.0

TokenSources.GetTokenStream Method

Overload List

public static TokenStream GetTokenStream(IndexReader,int,string);

public static TokenStream GetTokenStream(IndexReader,int,string,Analyzer);

public static TokenStream GetTokenStream(TermPositionVector);

Low level api. Returns a token stream or null if no offset info available in index. This can be used to feed the highlighter with a pre-parsed token stream In my tests the speeds to recreate 1000 token streams using this method are: - with TermVector offset only data stored - 420 milliseconds - with TermVector offset AND position data stored - 271 milliseconds (nb timings for TermVector with position data are based on a tokenizer with contiguous positions - no overlaps or gaps) The cost of not using TermPositionVector to store pre-parsed content and using an analyzer to re-parse the original content: - reanalyzing the original content - 980 milliseconds The re-analyze timings will typically vary depending on - 1) The complexity of the analyzer code (timings above were using a stemmer/lowercaser/stopword combo) 2) The number of other fields (Lucene reads ALL fields off the disk when accessing just one document field - can cost dear!) 3) Use of compression on field storage - could be faster cos of compression (less disk IO) or slower (more CPU burn) depending on the content.

public static TokenStream GetTokenStream(TermPositionVector,bool);

See Also

TokenSources Class | Lucene.Net.Highlight Namespace


TokenSources.GetTokenStream Method (IndexReader, Int32, String)

public static TokenStream GetTokenStream(
IndexReader reader,
int docId,
string field
);

See Also

TokenSources Class | Lucene.Net.Highlight Namespace | TokenSources.GetTokenStream Overload List


TokenSources.GetTokenStream Method (IndexReader, Int32, String, Analyzer)

public static TokenStream GetTokenStream(
IndexReader reader,
int docId,
string field,
Analyzer analyzer
);

See Also

TokenSources Class | Lucene.Net.Highlight Namespace | TokenSources.GetTokenStream Overload List


TokenSources.GetTokenStream Method (TermPositionVector)

public static TokenStream GetTokenStream(
TermPositionVector tpv
);

See Also

TokenSources Class | Lucene.Net.Highlight Namespace | TokenSources.GetTokenStream Overload List


TokenSources.GetTokenStream Method (TermPositionVector, Boolean)

Low level api. Returns a token stream or null if no offset info available in index. This can be used to feed the highlighter with a pre-parsed token stream In my tests the speeds to recreate 1000 token streams using this method are: - with TermVector offset only data stored - 420 milliseconds - with TermVector offset AND position data stored - 271 milliseconds (nb timings for TermVector with position data are based on a tokenizer with contiguous positions - no overlaps or gaps) The cost of not using TermPositionVector to store pre-parsed content and using an analyzer to re-parse the original content: - reanalyzing the original content - 980 milliseconds The re-analyze timings will typically vary depending on - 1) The complexity of the analyzer code (timings above were using a stemmer/lowercaser/stopword combo) 2) The number of other fields (Lucene reads ALL fields off the disk when accessing just one document field - can cost dear!) 3) Use of compression on field storage - could be faster cos of compression (less disk IO) or slower (more CPU burn) depending on the content.

public static TokenStream GetTokenStream(
TermPositionVector tpv,
bool tokenPositionsGuaranteedContiguous
);

Parameters

tpv
tokenPositionsGuaranteedContiguous
true if the token position numbers have no overlaps or gaps. If looking to eek out the last drops of performance, set to true. If in doubt, set to false.

See Also

TokenSources Class | Lucene.Net.Highlight Namespace | TokenSources.GetTokenStream Overload List


TokenSources.StoredTokenStream Class

For a list of all members of this type, see TokenSources.StoredTokenStream Members.

System.Object
Lucene.Net.Analysis.TokenStream
Lucene.Net.Highlight.TokenSources.StoredTokenStream

public class TokenSources.StoredTokenStream : TokenStream

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

TokenSources.StoredTokenStream Members | Lucene.Net.Highlight Namespace


TokenSources.StoredTokenStream Members

TokenSources.StoredTokenStream overview

Public Instance Methods

Close (inherited from Lucene.Net.Analysis.TokenStream) |
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Next |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TokenSources.StoredTokenStream Class | Lucene.Net.Highlight Namespace


TokenSources.StoredTokenStream Methods

The methods of the TokenSources.StoredTokenStream class are listed below. For a complete list of TokenSources.StoredTokenStream class members, see the TokenSources.StoredTokenStream Members topic.

Public Instance Methods

Close (inherited from Lucene.Net.Analysis.TokenStream) |
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Next |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TokenSources.StoredTokenStream Class | Lucene.Net.Highlight Namespace


TokenSources.StoredTokenStream.Next Method

public override Token Next();

See Also

TokenSources.StoredTokenStream Class | Lucene.Net.Highlight Namespace


WeightedTerm Class

Lightweight class to hold term and a weight value used for scoring this term

For a list of all members of this type, see WeightedTerm Members.

System.Object
Lucene.Net.Highlight.WeightedTerm

public class WeightedTerm

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: Lucene.Net.Highlight

Assembly: Highlighter.Net (in Highlighter.Net.dll)

See Also

WeightedTerm Members | Lucene.Net.Highlight Namespace


WeightedTerm Members

WeightedTerm overview

Public Instance Constructors

WeightedTerm Constructor

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetTerm |
GetType (inherited from Object) | Gets the Type of the current instance.
GetWeight |
SetTerm |
SetWeight |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

WeightedTerm Class | Lucene.Net.Highlight Namespace


WeightedTerm Constructor

public WeightedTerm(
float weight,
string term
);

See Also

WeightedTerm Class | Lucene.Net.Highlight Namespace


WeightedTerm Methods

The methods of the WeightedTerm class are listed below. For a complete list of WeightedTerm class members, see the WeightedTerm Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetTerm |
GetType (inherited from Object) | Gets the Type of the current instance.
GetWeight |
SetTerm |
SetWeight |
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

WeightedTerm Class | Lucene.Net.Highlight Namespace


WeightedTerm.GetTerm Method

public virtual string GetTerm();

Return Value

the term value (stemmed)

See Also

WeightedTerm Class | Lucene.Net.Highlight Namespace


WeightedTerm.GetWeight Method

public virtual float GetWeight();

Return Value

the weight associated with this term

See Also

WeightedTerm Class | Lucene.Net.Highlight Namespace


WeightedTerm.SetTerm Method

public virtual void SetTerm(
string term
);

Parameters

term
the term value (stemmed)

See Also

WeightedTerm Class | Lucene.Net.Highlight Namespace


WeightedTerm.SetWeight Method

public virtual void SetWeight(
float weight
);

Parameters

weight
the weight associated with this term

See Also

WeightedTerm Class | Lucene.Net.Highlight Namespace


Lucene.Net.HighlightHierarchy

Highlighter.Net 2.0.0

Lucene.Net.Highlight Hierarchy

System.Object
Lucene.Net.Analysis.TokenStream
Lucene.Net.Highlight.TokenSources.StoredTokenStream
Lucene.Net.Highlight.DefaultEncoder ---- Lucene.Net.Highlight.Encoder
Lucene.Net.Highlight.Encoder
Lucene.Net.Highlight.Formatter
Lucene.Net.Highlight.Fragmenter
Lucene.Net.Highlight.GradientFormatter ---- Lucene.Net.Highlight.Formatter
Lucene.Net.Highlight.SpanGradientFormatter
Lucene.Net.Highlight.Highlighter
Lucene.Net.Highlight.NullFragmenter ---- Lucene.Net.Highlight.Fragmenter
Lucene.Net.Highlight.QueryScorer ---- Lucene.Net.Highlight.Scorer
Lucene.Net.Highlight.QueryTermExtractor
Lucene.Net.Highlight.Scorer
Lucene.Net.Highlight.SimpleFragmenter ---- Lucene.Net.Highlight.Fragmenter
Lucene.Net.Highlight.SimpleHTMLEncoder ---- Lucene.Net.Highlight.Encoder
Lucene.Net.Highlight.SimpleHTMLFormatter ---- Lucene.Net.Highlight.Formatter
Lucene.Net.Highlight.TextFragment
Lucene.Net.Highlight.TokenGroup
Lucene.Net.Highlight.TokenSources
Lucene.Net.Highlight.WeightedTerm

See Also

Lucene.Net.Highlight Namespace