Class CustomScoreProvider
An instance of this subclass should be returned by GetCustomScoreProvider(AtomicReaderContext), if you want to modify the custom score calculation of a CustomScoreQuery.
Since Lucene 2.9, queries operate on each segment of an index separately,
so the protected m_context field can be used to resolve doc IDs,
as the supplied doc
ID is per-segment and without knowledge
of the IndexReader you cannot access the document or IFieldCache.
@lucene.experimental @since 2.9.2
Inheritance
Assembly: DistributedLucene.Net.Queries.dll
Syntax
public class CustomScoreProvider : object
Constructors
Name | Description |
---|---|
CustomScoreProvider(AtomicReaderContext) | Creates a new instance of the provider class for the given IndexReader. |
Fields
Name | Description |
---|---|
m_context |
Methods
Name | Description |
---|---|
CustomExplain(Int32, Explanation, Explanation) | Explain the custom score. Whenever overriding CustomScore(Int32, Single, Single), this method should also be overridden to provide the correct explanation for the part of the custom scoring. |
CustomExplain(Int32, Explanation, Explanation[]) | Explain the custom score. Whenever overriding CustomScore(Int32, Single, Single[]), this method should also be overridden to provide the correct explanation for the part of the custom scoring. |
CustomScore(Int32, Single, Single) | Compute a custom score by the Subclasses can override this method to modify the custom score. If your custom scoring is different than the default herein you should override at least one of the two CustomScore(Int32, Single, Single) methods. If the number of FunctionQuerys is always < 2 it is sufficient to override this CustomScore(Int32, Single, Single) method, which is simpler. The default computation herein is a multiplication of the two scores:
|
CustomScore(Int32, Single, Single[]) | Compute a custom score by the subQuery score and a number of FunctionQuery scores.
Subclasses can override this method to modify the custom score. If your custom scoring is different than the default herein you should override at least one of the two CustomScore(Int32, Single, Single) methods. If the number of FunctionQuerys is always < 2 it is sufficient to override the other CustomScore(Int32, Single, Single) method, which is simpler. The default computation herein is a multiplication of given scores:
|