Class BooleanQuery.BooleanWeight
Expert: the Weight for BooleanQuery, used to normalize, score and explain these queries.
Note
This API is experimental and might change in incompatible ways in the next release.
Inherited Members
Namespace: Lucene.Net.Search
Assembly: Lucene.Net.dll
Syntax
public class BooleanQuery.BooleanWeight : Weight
Constructors
BooleanWeight(BooleanQuery, IndexSearcher, bool)
Expert: the Weight for BooleanQuery, used to normalize, score and explain these queries.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public BooleanWeight(BooleanQuery outerInstance, IndexSearcher searcher, bool disableCoord)
Parameters
Type | Name | Description |
---|---|---|
BooleanQuery | outerInstance | |
IndexSearcher | searcher | |
bool | disableCoord |
Fields
m_maxCoord
Expert: the Weight for BooleanQuery, used to normalize, score and explain these queries.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
protected int m_maxCoord
Field Value
Type | Description |
---|---|
int |
m_similarity
The Similarity implementation.
Declaration
protected Similarity m_similarity
Field Value
Type | Description |
---|---|
Similarity |
m_weights
Expert: the Weight for BooleanQuery, used to normalize, score and explain these queries.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
protected IList<Weight> m_weights
Field Value
Type | Description |
---|---|
IList<Weight> |
Properties
MaxCoord
Expert: the Weight for BooleanQuery, used to normalize, score and explain these queries.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public int MaxCoord { get; }
Property Value
Type | Description |
---|---|
int |
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
Similarity
Expert: the Weight for BooleanQuery, used to normalize, score and explain these queries.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public Similarity Similarity { get; }
Property Value
Type | Description |
---|---|
Similarity |
Methods
Coord(int, int)
Expert: the Weight for BooleanQuery, used to normalize, score and explain these queries.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public virtual float Coord(int overlap, int maxOverlap)
Parameters
Type | Name | Description |
---|---|---|
int | overlap | |
int | maxOverlap |
Returns
Type | Description |
---|---|
float |
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 |