Method CustomScore
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:
ModifiedScore = valSrcScore * valSrcScores[0] * valSrcScores[1] * ...
Declaration
public virtual float CustomScore(int doc, float subQueryScore, float[] valSrcScores)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | doc | id of scored doc. |
System.Single | subQueryScore | score of that doc by the subQuery. |
System.Single[] | valSrcScores | scores of that doc by the FunctionQuery. |
Returns
Type | Description |
---|---|
System.Single | custom score. |
CustomScore(Int32, Single, Single)
Compute a custom score by the subQueryScore
and the FunctionQuery score.
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:
ModifiedScore = subQueryScore * valSrcScore
Declaration
public virtual float CustomScore(int doc, float subQueryScore, float valSrcScore)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | doc | id of scored doc. |
System.Single | subQueryScore | score of that doc by the subQuery. |
System.Single | valSrcScore | score of that doc by the FunctionQuery. |
Returns
Type | Description |
---|---|
System.Single | custom score. |