Elasticsearch query and sorting by parameters Ask

How can I query and sort text by below parameter in elasticsearch

1 - search query be exact in the first part of results

2 - search query be exact in another part of the result

3 - results contain all words of the search query

For example :

I searching i love dogs

Results respectively must be :

      1-  I love dogs

      2 - i love dogs and birds

      3 - birds good but i love dogs and horses 

      4 - Horses and i love dogs

      5 - I love horses and dogs

      6 - good dogs and i love horses

Have a look at this script:

This might give you some ideas.

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