# How to search for specific word and exact match in Elasticsearch

**URL:** <https://discuss.elastic.co/t/how-to-search-for-specific-word-and-exact-match-in-elasticsearch/314471>\
**Category:** Elasticsearch\
**Created:** [September 15, 2022, 3:53am UTC](https://discuss.elastic.co/t/how-to-search-for-specific-word-and-exact-match-in-elasticsearch/314471 "2022-09-15T03:53:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amitav](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@Amitav](https://discuss.elastic.co/u/Amitav)\
**Post date:** [September 15, 2022, 3:53am UTC](https://discuss.elastic.co/t/how-to-search-for-specific-word-and-exact-match-in-elasticsearch/314471/1 "2022-09-15T03:53:46Z")

</div>

**sample data for title**

```auto
actiontype test
booleanTest
test-demo
test_demo
Test new account object
sync accounts data test

```

**default Mapping for title**

```auto
"title": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
 },

```

**tried with this query search**

```auto
{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "title": "test"
          }
        }
      ]
    }
  },
}

```

**here my expectation**

with specific word(e.g. : test ) it should return following titles

```auto
expect
        actiontype test
        booleanTest
        test-demo
        test_demo
        Test new account object
        sync accounts data test

```

**But**

```auto
got
            actiontype test
            test-demo
            test_demo
            Test new account object
            sync accounts data test

```

With exact match (e.g. : sync accounts data test ) it should return only this(`sync accounts data test`) but got all records those contains this words (`sync,account,data,test`).

What should I do to make this happen ? Thanks.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 15, 2022, 5:49am UTC](https://discuss.elastic.co/t/how-to-search-for-specific-word-and-exact-match-in-elasticsearch/314471/2 "2022-09-15T05:49:10Z")

</div>

Welcome!

Try with:

```auto
{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "title.keyword": "test"
          }
        }
      ]
    }
  }
```

---

<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 13, 2022, 5:49am UTC](https://discuss.elastic.co/t/how-to-search-for-specific-word-and-exact-match-in-elasticsearch/314471/3 "2022-10-13T05:49:46Z")

</div>

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