Method CustomScore
CustomScore(Int32, Single, Single[])
- Compute a custom score by the subQuery score and a number of
ValueSourceQuery 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() methods. If the number of ValueSourceQueries 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 ValueSourceQuery |
Returns
Type | Description |
---|---|
System.Single | custom score |
CustomScore(Int32, Single, Single)
Compute a custom score by the subQuery score and the ValueSourceQuery 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() methods. If the number of ValueSourceQueries is always < 2 it is sufficient to override this customScore() 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 ValueSourceQuery |
Returns
Type | Description |
---|---|
System.Single | custom score |