Elasticsearh Sort With _score Fulltext

Viewed 34

I am trying to sort using a script sort. My script would look like: _score * doc['someField'].value When I submit the query I am getting: unresolvable property or identifier: _score

Is it not possible to use the score in a script sort?

Thanks!

1 Answers

In the sort painless script, I guess not. But you could try to take a look at function score query with a script_score. The original score can be used in the script as _score

Example:

        "script_score": {
            "script": {
                "source": "_score * doc['someField'].value"
            }
        }
Related