Elasticsearch query result order based on matching position

I have two sentences.

  1. Model text
  2. Jug Model

if I query for 'model' or 'del' result is coming in below order

  1. Jug Model
  2. Model Text

Is there any way I can get "Model Text" first, since its the best match. I know about edge_ngram. but here requirement is, user may type text in the middle also like "del" and the result should be in same order.

Any help would be appreciated. Thanks

Could you describe the model that you have in mind in more details with more examples? I am not really sure what you are trying to achieve here. Can you have more than 2 words? How matching the second word in more than one record would work?

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