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:
kimchy 2010-08-12 18:41:29 +03:00
parent 98bc8285ea
commit 2bd9a63467
1 changed files with 1 additions and 0 deletions

View File

@ -120,6 +120,7 @@ public class CustomScoreQueryParser extends AbstractIndexComponent implements XC
@Override public float score(int docId, float subQueryScore) {
vars.put("score", subQueryScore);
vars.put("_score", subQueryScore);
return ((Number) scriptFieldsFunction.execute(docId, vars)).floatValue();
}