Query DSL: custom score script, allow to use `_score` as well as `score` as the underlying query score, closes #316.
This commit is contained in:
parent
98bc8285ea
commit
2bd9a63467
|
@ -120,6 +120,7 @@ public class CustomScoreQueryParser extends AbstractIndexComponent implements XC
|
||||||
|
|
||||||
@Override public float score(int docId, float subQueryScore) {
|
@Override public float score(int docId, float subQueryScore) {
|
||||||
vars.put("score", subQueryScore);
|
vars.put("score", subQueryScore);
|
||||||
|
vars.put("_score", subQueryScore);
|
||||||
return ((Number) scriptFieldsFunction.execute(docId, vars)).floatValue();
|
return ((Number) scriptFieldsFunction.execute(docId, vars)).floatValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue