Lucene.Net
3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
|
Expert: Calculate query weights and build query scorers. The purpose of Weight is to ensure searching does not modify a Query, so that a Query instance can be reused.
Searcher dependent state of the query should reside in the Weight.
IndexReader dependent state should reside in the Scorer. A Weight
is used in the following way:
Weight
is constructed by a top-level query, given a Searcher
(Lucene.Net.Search.Query.CreateWeight(Searcher)). Weight
to compute the query normalization factor Similarity.QueryNorm(float) of the query clauses contained in the query. Scorer
is constructed by Scorer(IndexReader,bool,bool). Inherited by Lucene.Net.Search.BooleanQuery.BooleanWeight, Lucene.Net.Search.ConstantScoreQuery.ConstantWeight, Lucene.Net.Search.DisjunctionMaxQuery.DisjunctionMaxWeight, Lucene.Net.Search.FilteredQuery.AnonymousClassWeight, Lucene.Net.Search.Function.CustomScoreQuery.CustomWeight, Lucene.Net.Search.Function.ValueSourceQuery.ValueSourceWeight, Lucene.Net.Search.MatchAllDocsQuery.MatchAllDocsWeight, Lucene.Net.Search.MultiPhraseQuery.MultiPhraseWeight, Lucene.Net.Search.PhraseQuery.PhraseWeight, Lucene.Net.Search.Spans.SpanWeight, Lucene.Net.Search.TermQuery.TermWeight, and Lucene.Net.Spatial.Util.FunctionQuery.FunctionWeight.
Public Member Functions | |
abstract Explanation | Explain (IndexReader reader, int doc) |
An explanation of the score computation for the named document. | |
abstract void | Normalize (float norm) |
Assigns the query normalization factor to this. | |
abstract Scorer | Scorer (IndexReader reader, bool scoreDocsInOrder, bool topScorer) |
Returns a Scorer which scores documents in/out-of order according to scoreDocsInOrder . NOTE: even if scoreDocsInOrder is false, it is recommended to check whether the returned Scorer indeed scores documents out of order (i.e., call GetScoresDocsOutOfOrder()), as some Scorer implementations will always return documents in-order.NOTE: null can be returned if no documents will be scored by this query. | |
abstract float | GetSumOfSquaredWeights () |
The sum of squared weights of contained query clauses. | |
virtual bool | GetScoresDocsOutOfOrder () |
Returns true iff this implementation scores docs only out of order. This method is used in conjunction with Collector's AcceptsDocsOutOfOrder and Scorer(Lucene.Net.Index.IndexReader, bool, bool) to create a matching Scorer instance for a given Collector, or vice versa. NOTE: the default implementation returns false , i.e. the Scorer scores documents in-order. | |
Properties | |
abstract Query | Query [get] |
The query that this concerns. | |
abstract float | Value [get] |
The weight for this query. | |
Expert: Calculate query weights and build query scorers.
The purpose of Weight is to ensure searching does not modify a Query, so that a Query instance can be reused.
Searcher dependent state of the query should reside in the Weight.
IndexReader dependent state should reside in the Scorer.
A Weight
is used in the following way:
Weight
is constructed by a top-level query, given a Searcher
(Lucene.Net.Search.Query.CreateWeight(Searcher)). Weight
to compute the query normalization factor Similarity.QueryNorm(float) of the query clauses contained in the query. Scorer
is constructed by Scorer(IndexReader,bool,bool). <since> 2.9 </since>
|
pure virtual |
An explanation of the score computation for the named document.
reader | sub-reader containing the give doc |
doc |
<throws> IOException </throws>
Implemented in Lucene.Net.Spatial.Util.FunctionQuery.FunctionWeight, and Lucene.Net.Search.Spans.SpanWeight.
|
virtual |
Returns true iff this implementation scores docs only out of order. This method is used in conjunction with Collector's AcceptsDocsOutOfOrder and Scorer(Lucene.Net.Index.IndexReader, bool, bool) to create a matching Scorer instance for a given Collector, or vice versa. NOTE: the default implementation returns false
, i.e. the Scorer
scores documents in-order.
|
pure virtual |
The sum of squared weights of contained query clauses.
Implemented in Lucene.Net.Spatial.Util.FunctionQuery.FunctionWeight, and Lucene.Net.Search.Spans.SpanWeight.
|
pure virtual |
Assigns the query normalization factor to this.
Implemented in Lucene.Net.Spatial.Util.FunctionQuery.FunctionWeight, and Lucene.Net.Search.Spans.SpanWeight.
|
pure virtual |
Returns a Scorer which scores documents in/out-of order according to scoreDocsInOrder
. NOTE: even if scoreDocsInOrder
is false, it is recommended to check whether the returned Scorer
indeed scores documents out of order (i.e., call GetScoresDocsOutOfOrder()), as some Scorer
implementations will always return documents in-order.
NOTE: null can be returned if no documents will be scored by this query.
reader | the IndexReader for which to return the Lucene.Net.Search.Scorer. |
scoreDocsInOrder | specifies whether in-order scoring of documents is required. Note that if set to false (i.e., out-of-order scoring is required), this method can return whatever scoring mode it supports, as every in-order scorer is also an out-of-order one. However, an out-of-order scorer may not support DocIdSetIterator.NextDoc and/or DocIdSetIterator.Advance(int), therefore it is recommended to request an in-order scorer if use of these methods is required. |
topScorer | if true, Lucene.Net.Search.Scorer.Score(Lucene.Net.Search.Collector) will be called; if false, DocIdSetIterator.NextDoc and/or DocIdSetIterator.Advance(int) will be called. |
<throws> IOException </throws>
Implemented in Lucene.Net.Spatial.Util.FunctionQuery.FunctionWeight, and Lucene.Net.Search.Spans.SpanWeight.
|
get |
|
get |