Lucene.Net  3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties
Public Member Functions | Properties | List of all members
Lucene.Net.Search.Weight Class Referenceabstract

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:

More...

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.
 

Detailed Description

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:

<since> 2.9 </since>

Definition at line 50 of file Weight.cs.

Member Function Documentation

abstract Explanation Lucene.Net.Search.Weight.Explain ( IndexReader  reader,
int  doc 
)
pure virtual

An explanation of the score computation for the named document.

Parameters
readersub-reader containing the give doc
doc
Returns
an Explanation for the score

<throws> IOException </throws>

Implemented in Lucene.Net.Spatial.Util.FunctionQuery.FunctionWeight, and Lucene.Net.Search.Spans.SpanWeight.

virtual bool Lucene.Net.Search.Weight.GetScoresDocsOutOfOrder ( )
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.

Definition at line 122 of file Weight.cs.

abstract float Lucene.Net.Search.Weight.GetSumOfSquaredWeights ( )
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.

abstract void Lucene.Net.Search.Weight.Normalize ( float  norm)
pure virtual

Assigns the query normalization factor to this.

Implemented in Lucene.Net.Spatial.Util.FunctionQuery.FunctionWeight, and Lucene.Net.Search.Spans.SpanWeight.

abstract Scorer Lucene.Net.Search.Weight.Scorer ( IndexReader  reader,
bool  scoreDocsInOrder,
bool  topScorer 
)
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.

Parameters
readerthe IndexReader for which to return the Lucene.Net.Search.Scorer.
scoreDocsInOrderspecifies 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.
topScorerif 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.
Returns
a Scorer which scores documents in/out-of order.

<throws> IOException </throws>

Implemented in Lucene.Net.Spatial.Util.FunctionQuery.FunctionWeight, and Lucene.Net.Search.Spans.SpanWeight.

Property Documentation

abstract Query Lucene.Net.Search.Weight.Query
get

The query that this concerns.

Definition at line 66 of file Weight.cs.

abstract float Lucene.Net.Search.Weight.Value
get

The weight for this query.

Definition at line 69 of file Weight.cs.


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