Fuzzy and strict match with multiple fields

We want to leverage ElasticSearch to find us similar objects.

Lets say I have an Object with 4 fields: product_name, seller_name, seller_phone, platform_id.

Similar products can have different product names and seller names across different platforms (fuzzy match).

While, phone is strict and a single variation might cause yield a wrong record (strict match).

What were trying to create is a query that will:

  1. Take into account all fields we have for current record and OR between them.
  2. Mandate platform_id is the one I want to specific look at. (AND)
  3. Fuzzy the product_name and seller_name
  4. Strictly match the phone number or ignore it in the OR between the fields.

If I would write it in pseudo code, I would write something like:

((product_name like 'some_product_name') OR (seller_name like 'some_seller_name') OR (seller_phone = 'some_phone')) AND (platform_id = 123)

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