Reputation: 83
I work with elasticsearch with symfony2.
I have a database with music artists.
When I try to search for example "emine*"
with a wildcard, I got in the firsts results "Eminence of Darkness"
or another's ones instead of "Eminem"
which is closest to my query.
What can I do to get "Eminem"
in the first result?
Upvotes: 1
Views: 440
Reputation: 99
You could also try the Prefix Query for boosting the results:
https://www.elastic.co/guide/en/elasticsearch/reference/5.1/query-dsl-prefix-query.html
Upvotes: 0
Reputation: 17461
Wildcard query by default uses constant_score_auto as rewrite parameter which gives the same score for all matches.
For the example in the question probably you could sort the matched results by Artist.sort_name to get the desired result .
Upvotes: 1