I have this kind of Groovy script:
def multiplier = doc['data'].value
if (multiplier <= 0) {
multiplier = 1
}
multiplier * _score
I use it as script_score, and my score is always 0. It _scorealways seems to be 0. It works with the mvel script.
mvel script was:
_score * doc['data'].value
Request (only langchanges for mvel version):
"function_score": {
query: {
"bool": {
"should": [
],
"minimum_should_match": 1,
},
},
"script_score": {
"lang": "groovy",
"file": "my_script",
},
"boost": 2.5,
"score_mode": "max",
}
Am I doing something wrong? I tested this on Elasticsearch 1.5.2.
source
share