# Fuzzy and strict match with multiple fields

**URL:** <https://discuss.elastic.co/t/fuzzy-and-strict-match-with-multiple-fields/89195>\
**Category:** Elasticsearch\
**Created:** [June 13, 2017, 1:18pm UTC](https://discuss.elastic.co/t/fuzzy-and-strict-match-with-multiple-fields/89195 "2017-06-13T13:18:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan\_Benjamin](https://avatars.discourse-cdn.com/v4/letter/d/58f4c7/32.png) [@Dan\_Benjamin](https://discuss.elastic.co/u/Dan_Benjamin)\
**Post date:** [June 13, 2017, 1:18pm UTC](https://discuss.elastic.co/t/fuzzy-and-strict-match-with-multiple-fields/89195/1 "2017-06-13T13:18:59Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 11, 2017, 1:19pm UTC](https://discuss.elastic.co/t/fuzzy-and-strict-match-with-multiple-fields/89195/2 "2017-07-11T13:19:01Z")

</div>

Closed on July 11, 2017, 1:19pm UTC

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