Class ConstantScoreQuery.ConstantWeight
Inherited Members
Namespace: Lucene.Net.Search
Assembly: Lucene.Net.dll
Syntax
protected class ConstantScoreQuery.ConstantWeight : Weight
Constructors
ConstantWeight(ConstantScoreQuery, IndexSearcher)
Declaration
public ConstantWeight(ConstantScoreQuery outerInstance, IndexSearcher searcher)
Parameters
Type | Name | Description |
---|---|---|
ConstantScoreQuery | outerInstance | |
IndexSearcher | searcher |
Properties
Query
The query that this concerns.
Declaration
public override Query Query { get; }
Property Value
Type | Description |
---|---|
Query |
Overrides
ScoresDocsOutOfOrder
Returns true if this implementation scores docs only out of order. This method is used in conjunction with ICollector's AcceptsDocsOutOfOrder and GetBulkScorer(AtomicReaderContext, bool, IBits) to create a matching Scorer instance for a given ICollector, or vice versa.
NOTE: the default implementation returnsfalse
, i.e.
the Scorer scores documents in-order.
Declaration
public override bool ScoresDocsOutOfOrder { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
Methods
Explain(AtomicReaderContext, int)
An explanation of the score computation for the named document.
Declaration
public override Explanation Explain(AtomicReaderContext context, int doc)
Parameters
Type | Name | Description |
---|---|---|
AtomicReaderContext | context | The readers context to create the Explanation for. |
int | doc | The document's id relative to the given context's reader |
Returns
Type | Description |
---|---|
Explanation | An Explanation for the score |
Overrides
Exceptions
Type | Condition |
---|---|
IOException | if an IOException occurs |
GetBulkScorer(AtomicReaderContext, bool, IBits)
Optional method, to return a BulkScorer to score the query and send hits to a ICollector. Only queries that have a different top-level approach need to override this; the default implementation pulls a normal Scorer and iterates and collects the resulting hits.
Declaration
public override BulkScorer GetBulkScorer(AtomicReaderContext context, bool scoreDocsInOrder, IBits acceptDocs)
Parameters
Type | Name | Description |
---|---|---|
AtomicReaderContext | context | The AtomicReaderContext for which to return the Scorer. |
bool | scoreDocsInOrder | Specifies whether in-order scoring of documents is required. Note
that if set to |
IBits | acceptDocs | IBits that represent the allowable docs to match (typically deleted docs but possibly filtering other documents) |
Returns
Type | Description |
---|---|
BulkScorer | A BulkScorer which scores documents and passes them to a collector. |
Overrides
Exceptions
Type | Condition |
---|---|
IOException | if there is a low-level I/O error |
GetScorer(AtomicReaderContext, IBits)
Returns a Scorer which scores documents in/out-of order according
to scoreDocsInOrder
.
scoreDocsInOrder
is false
, it is
recommended to check whether the returned Scorer indeed scores
documents out of order (i.e., call ScoresDocsOutOfOrder), as
some Scorer implementations will always return documents
in-order.
NOTE:null
can be returned if no documents will be scored by this
query.
Declaration
public override Scorer GetScorer(AtomicReaderContext context, IBits acceptDocs)
Parameters
Type | Name | Description |
---|---|---|
AtomicReaderContext | context | The AtomicReaderContext for which to return the Scorer. |
IBits | acceptDocs | IBits that represent the allowable docs to match (typically deleted docs but possibly filtering other documents) |
Returns
Type | Description |
---|---|
Scorer | A Scorer which scores documents in/out-of order. |
Overrides
Exceptions
Type | Condition |
---|---|
IOException | if there is a low-level I/O error |
GetValueForNormalization()
The value for normalization of contained query clauses (e.g. sum of squared weights).
Declaration
public override float GetValueForNormalization()
Returns
Type | Description |
---|---|
float |
Overrides
Normalize(float, float)
Assigns the query normalization factor and boost from parent queries to this.
Declaration
public override void Normalize(float norm, float topLevelBoost)
Parameters
Type | Name | Description |
---|---|---|
float | norm | |
float | topLevelBoost |