Elastic search functionScore vs sort by script

480 Views Asked by At

I want to change the score of the results from query. I can change the result by boosting and filtering. However, I can do this both function score and script query. What is the difference between them?

For example: functionScoreQuery(someQuery).scorers(scriptScore(....)) and sort(scriptSort(.....))

1

There are 1 best solutions below

0
On

A function scorer can be applied to a subset of the results by applying a filter. The sort will be applied to all results in the search. So if you say wanted everything in London to have one script score, and everything in Paris another, you could do that with function scorers.