0

I am having problems with fuzzy queries giving higher relavance to the fuzzy hit term than the direct match. I dont understand why - even after having rtfm.

  1. Creating a new index

curl -XPUT http://192.168.178.40:9200/test_test_test

  1. Inserting to entries
curl -XPUT http://192.168.178.40:9200/test_test_test/test/1 -d '{ "name": "nike" }'

curl -XPUT http://192.168.178.40:9200/test_test_test/test/2 -d '{ "name": "bike" }'
  1. Querying for search term "bike"

curl -XPOST http://192.168.178.40:9200/test_test_test/test/_search -d '{ "query": { "match": { "name": { "query": "bike", "fuzziness": "1" } } } }' | jq

This gives a result with nike having higher relevance than bike. Why is that and how can this be fixed?

result

Michael Leiss
  • 5,395
  • 3
  • 21
  • 27
  • Using your example in 6.5.4, I was unable to get the same results - the `bike` document always returned a higher score. Can you note what version you're using? Additionally, can you post the output of `explain` for both documents? E.g.: GET test_test_test/test/1/_explain?format=yaml { } – James Pittiglio Apr 10 '19 at 17:14
  • Its happening with ES 2.3. – Michael Leiss Apr 11 '19 at 11:25
  • Unfortunately I'm not familiar with how scoring has changed since then - if you could run `explain` on both and post the results, it should shed some additional insight: GET test_test_test/test/1/_explain?format=yaml { } GET test_test_test/test/2/_explain?format=yaml { } – James Pittiglio Apr 12 '19 at 12:34

0 Answers0