How sorting result for ecommerce

Hi to all, i don't understan what is the best solution for sort search result in my ecommerce. I have a index 'product', with same filed. The field 'name' have this mapping:
['type' => 'text', 'term_vector' => 'with_positions']
I have same product, for example:

  • Apple Iphone 11 6/64GB Black
  • Flip cover for Apple iphone 11
  • Screen protector for Apple iphone 11
  • Apple Iphone 11 6/128GB White

If i search for query 'Apple iphone 11', i need results in this order:

  1. Apple Iphone 11 6/64GB Black
  2. Apple Iphone 11 6/128GB White
  3. Flip cover for Apple iphone 11
  4. Screen protector for Apple iphone 11

But if i use match, match_phrase, multi_match, i have result in different order. I think is important that the query, if is situated in the first part of product name, give a better rate to the item, but in what way i can have this result?

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