How to implement ranking based on many fields?


(Кирилл Шнуров) #1

When user types something like "*italian restaurant with wi-fi at 5th avenue
*", I want to find document with:
address (string) - 5th avenue
kitchens (array of strings) - italian
categories (array of strings) - restaurant
fields.name (string) - wi-fi (exists only when wi-fi = true)
"with" and "at" are already added to stopwords.

In Sphinx (Rails&ThinkingSphinx) it was done by: Place.search 'italian
restaurant with wi-fi on 5th avenue', :match_mode => :extended

But Sphinx uses proximity_bm25 ranking mode.

How can I achieve the same result with ES?
Searching with text '_all' gives no results at all, searching with dis_max
and many bools gives wrong ranking https://gist.github.com/3945005.

--


(system) #2