# How to filter the results based on a condition if there is a whole word match from y attribute in x attribute

**URL:** <https://discuss.elastic.co/t/how-to-filter-the-results-based-on-a-condition-if-there-is-a-whole-word-match-from-y-attribute-in-x-attribute/314843>\
**Category:** Elasticsearch\
**Created:** [September 21, 2022, 8:46am UTC](https://discuss.elastic.co/t/how-to-filter-the-results-based-on-a-condition-if-there-is-a-whole-word-match-from-y-attribute-in-x-attribute/314843 "2022-09-21T08:46:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arsoni20](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arsoni20/32/111070_2.png) [@arsoni20](https://discuss.elastic.co/u/arsoni20)\
**Post date:** [September 21, 2022, 8:46am UTC](https://discuss.elastic.co/t/how-to-filter-the-results-based-on-a-condition-if-there-is-a-whole-word-match-from-y-attribute-in-x-attribute/314843/1 "2022-09-21T08:46:07Z")

</div>

I want to do filtering based on a whole word match in Elasticsearch.

e.g.

```auto
POST /company/1
{
"name": "Hemani",
"age" : 23,
"experienceInYears" : 2,
"role" : "Python developer",
"object" :{
  "link":"Python, Scala, R"
}
}

```

I want to do match based on object.link in Role, if there is a whole word match then I want this document in my search.

But if it is something like this -

```auto
POST /company/1
{
"name": "Hemani",
"age" : 23,
"experienceInYears" : 2,
"role" : "Python developer",
"object" :{
  "link":"Rust"
}
}

```

In this case I dont want this to be returned.

Can anyone please point me in the right direction ?

---

<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:** [October 19, 2022, 8:46am UTC](https://discuss.elastic.co/t/how-to-filter-the-results-based-on-a-condition-if-there-is-a-whole-word-match-from-y-attribute-in-x-attribute/314843/2 "2022-10-19T08:46:15Z")

</div>

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