C# Class Lucene.Net.Search.Highlight.QueryScorer

IScorer implementation which scores text fragments by the number of unique query terms found. This class converts appropriate Querys to SpanQuerys and attempts to score only those terms that participated in generating the 'hit' on the document.
Inheritance: IScorer
Mostra file Open project: synhershko/lucene.net Class Usage Examples

Public Methods

Method Description
GetTokenScore ( ) : float
GetWeightedSpanTerm ( String token ) : WeightedSpanTerm

Retrieve the WeightedSpanTerm for the specified token. Useful for passing Span information to a IFragmenter.

Init ( TokenStream tokenStream ) : TokenStream
QueryScorer ( Query query ) : System

Constructs a new QueryScorer instance

QueryScorer ( Query query, IndexReader reader, String field ) : System

Constructs a new QueryScorer instance

QueryScorer ( Query query, IndexReader reader, String field, String defaultField ) : System

Constructs a new QueryScorer instance

QueryScorer ( Query query, String field ) : System

Constructs a new QueryScorer instance

QueryScorer ( Query query, String field, String defaultField ) : System

Constructs a new QueryScorer instance

QueryScorer ( WeightedSpanTerm weightedTerms ) : System

Constructs a new QueryScorer instance

SetWrapIfNotCachingTokenFilter ( bool wrap ) : void

By default, TokenStreams that are not of the type CachingTokenFilter are wrapped in a CachingTokenFilter to ensure an efficient reset - if you are already using a different caching TokenStream impl and you don't want it to be wrapped, set this to false.

StartFragment ( Lucene.Net.Search.Highlight.TextFragment newFragment ) : void

Private Methods

Method Description
Init ( Query query, String field, IndexReader reader, bool expandMultiTermQuery ) : void
InitExtractor ( TokenStream tokenStream ) : TokenStream

Method Details

GetTokenScore() public method

public GetTokenScore ( ) : float
return float

GetWeightedSpanTerm() public method

Retrieve the WeightedSpanTerm for the specified token. Useful for passing Span information to a IFragmenter.
public GetWeightedSpanTerm ( String token ) : WeightedSpanTerm
token String token to get {@link WeightedSpanTerm} for
return WeightedSpanTerm

Init() public method

public Init ( TokenStream tokenStream ) : TokenStream
tokenStream Lucene.Net.Analysis.TokenStream
return Lucene.Net.Analysis.TokenStream

QueryScorer() public method

Constructs a new QueryScorer instance
public QueryScorer ( Query query ) : System
query Query Query to use for highlighting
return System

QueryScorer() public method

Constructs a new QueryScorer instance
public QueryScorer ( Query query, IndexReader reader, String field ) : System
query Query Query to use for highlighting
reader Lucene.Net.Index.IndexReader to use for quasi tf/idf scoring
field String Field to highlight - pass null to ignore fields
return System

QueryScorer() public method

Constructs a new QueryScorer instance
public QueryScorer ( Query query, IndexReader reader, String field, String defaultField ) : System
query Query Query to use for highlighting
reader Lucene.Net.Index.IndexReader to use for quasi tf/idf scoring
field String Field to highlight - pass null to ignore fields
defaultField String The default field for queries with the field name unspecified
return System

QueryScorer() public method

Constructs a new QueryScorer instance
public QueryScorer ( Query query, String field ) : System
query Query Query to use for highlighting
field String Field to highlight - pass null to ignore fields
return System

QueryScorer() public method

Constructs a new QueryScorer instance
public QueryScorer ( Query query, String field, String defaultField ) : System
query Query Query to use for highlighting
field String Field to highlight - pass null to ignore fields
defaultField String The default field for queries with the field name unspecified
return System

QueryScorer() public method

Constructs a new QueryScorer instance
public QueryScorer ( WeightedSpanTerm weightedTerms ) : System
weightedTerms WeightedSpanTerm an array of pre-created s
return System

SetWrapIfNotCachingTokenFilter() public method

By default, TokenStreams that are not of the type CachingTokenFilter are wrapped in a CachingTokenFilter to ensure an efficient reset - if you are already using a different caching TokenStream impl and you don't want it to be wrapped, set this to false.
public SetWrapIfNotCachingTokenFilter ( bool wrap ) : void
wrap bool
return void

StartFragment() public method

public StartFragment ( Lucene.Net.Search.Highlight.TextFragment newFragment ) : void
newFragment Lucene.Net.Search.Highlight.TextFragment
return void