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:
- Take into account all fields we have for current record and OR between them.
- Mandate platform_id is the one I want to specific look at. (AND)
- Fuzzy the product_name and seller_name
- 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)