Elasticsearch query by position of word

Hi ,

when search with elasticsearch based on inverted indexing .

let us suppose we have 2 docs 1- game of thrones and 2- ender's game
when I am searching with game eaither game of thrones or ender's game will come first . I am using ngram tokenizer in index time and edgeNgram tokenizer at query time .

so for the auto complete when I am searching with "gam" -> ender's game appears first . But I want game of thrones to come first because it matches first in doc . [both are in title ]

so basically I want consider the order in which they appeat in doc.

example2 - 1- hello kitty , 2- kitty hello ..
when I am searching with hello ,hello kitty should come first then kitty hello

Is there any query which uses the order of word ?

Thanks,
Navneet

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.