Elasticsearch sort by multiple scores

Viewed 740

I am using elasticsearch 2.3. We know that ES provide a score to each document using its TF/IDF algo and other calculations. This could be in range of 1-100.

Now lets suppose i have an additional score for each document, a custom calculated score, that can be in range from 1 to 1000.

I want to use this new custom score for ranking of documents but since ES score is indeterministic i.e. it can range from 1 to 100 (given number of words match, fields etc), so normalising the new custom score and adding to ES score does not work. (samples below)

Is there any solution to using other custom scores but not ignoring ES score ?


Sample data

Note : Here i just added the custom score to ES score and results are unexpected.

ES query : anotepad.com/notes/e7t5yh

ES Results : anotepad.com/notes/5h6dtk

What you would see in the results is that even when i searched for "32 GB iphone", i got "Apple iphone 64 GB" on top since custom score of 64 GB is way higher than that of 32 GB.

0 Answers
Related