I'm moving from Sphinx to ES and I can't make ES to score results properly.
Mapping:
"properties" : {
"address" : {
"type" : "string",
"boost" : 20.0,
"analyzer" : "street_analyzer_index",
"omit_term_freq_and_positions" : true,
"search_quote_analyzer" : "street_analyzer_search"
},
"metro" : {
"properties" : {
"name_ru" : {
"type" : "string",
"boost" : 10.0,
"analyzer" : "street_analyzer_index",
"omit_term_freq_and_positions" : true,
"search_quote_analyzer" : "street_analyzer_search"
}
}
},
"name_en" : {
"type" : "string",
"boost" : 20.0,
"analyzer" : "word_analyzer_index",
"omit_term_freq_and_positions" : true,
"search_quote_analyzer" : "word_analyzer_search"
},
"name_ru" : {
"type" : "string",
"boost" : 20.0,
"index_analyzer" : "word_analyzer_index",
"search_analyzer" : "word_analyzer_search",
"omit_term_freq_and_positions" : true
}
Query (just some examples instead of the russian ones):
curl -X GET "http://localhost:9200/tomesto_places/place/_search?from=0&page=1&per_page=7&size=7&pretty=true" -d '{"query":{"custom_filters_score":{"query":{"dis_max":{"queries":[{"bool":{"should":[{"text":{"name_en":{"query":"bar 5th avenue","analyzer":"word_analyzer_search","fuzziness":0.8,"operator":"or","boost":20}}},{"text":{"name_en":{"query":"bar 5th avenue","analyzer":"word_analyzer_search","fuzziness":0.8,"operator":"or","boost":20}}},{"text":{"address":{"query":"bar 5th avenue","analyzer":"street_analyzer_search","fuzziness":0.8,"operator":"or","boost":10}}},{"text":{"metro.name_ru":{"query":"bar 5th avenue","analyzer":"street_analyzer_search","fuzziness":0.8,"operator":"or","boost":20}}}]}}]}}}}'
Results:
Great bar jackson st (score 43505656000.0 ??!!!)
awesome bar madelyn road (score 41732174200.0 ??!!!)
...
And nothing about "5th avenue"! I'm expecting items with name 'bar bla bla' and address '5th avenue 12' to be scored higher. Queries for just '5th avenue' gets a tiny score of ~4000. What am I doing wrong and how can I get proper results ranking? In same case Sphinx is working out of the box, ranking everything very well in extended match mode.
--