# How to get exact record which will match string?

**URL:** <https://discuss.elastic.co/t/how-to-get-exact-record-which-will-match-string/126379>\
**Category:** Elasticsearch\
**Created:** [April 2, 2018, 6:37am UTC](https://discuss.elastic.co/t/how-to-get-exact-record-which-will-match-string/126379 "2018-04-02T06:37:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shaik\_Thowsif](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@Shaik\_Thowsif](https://discuss.elastic.co/u/Shaik_Thowsif)\
**Post date:** [April 2, 2018, 6:37am UTC](https://discuss.elastic.co/t/how-to-get-exact-record-which-will-match-string/126379/1 "2018-04-02T06:37:20Z")

</div>

i want to get exact record from elasticsearch which field name should be exactly match with input query  
name.

for example:  
I am having record with name: "raj kumar fillings", while i am trying to get record with name:"raj" (only) then ES giving its output as "raj kumar fillings" record. Can anyone explain me what happening here?  
Thanks in Advacne

---

<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:** [April 2, 2018, 7:17am UTC](https://discuss.elastic.co/t/how-to-get-exact-record-which-will-match-string/126379/2 "2018-04-02T07:17:41Z")

</div>

Change the mapping for your field and use a keyword type or a keyword analyzer.

---

<div class="post-metadata">

**Author:** ![Shaik\_Thowsif](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@Shaik\_Thowsif](https://discuss.elastic.co/u/Shaik_Thowsif)\
**Post date:** [April 2, 2018, 8:50am UTC](https://discuss.elastic.co/t/how-to-get-exact-record-which-will-match-string/126379/3 "2018-04-02T08:50:28Z")

</div>

i cant underestand. can you tell briefly how can i use keyword analyser

---

<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:** [April 2, 2018, 9:44am UTC](https://discuss.elastic.co/t/how-to-get-exact-record-which-will-match-string/126379/4 "2018-04-02T09:44:31Z")

</div>

If you don't know what analyzers are here is some documentation: [https://www.elastic.co/guide/en/elasticsearch/reference/6.2/analysis.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/analysis.html)

---

<div class="post-metadata">

**Author:** ![Shaik\_Thowsif](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@Shaik\_Thowsif](https://discuss.elastic.co/u/Shaik_Thowsif)\
**Post date:** [April 2, 2018, 10:33am UTC](https://discuss.elastic.co/t/how-to-get-exact-record-which-will-match-string/126379/5 "2018-04-02T10:33:51Z")

</div>

Thanx.. its working...

---

<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:** [April 30, 2018, 10:34am UTC](https://discuss.elastic.co/t/how-to-get-exact-record-which-will-match-string/126379/6 "2018-04-30T10:34:03Z")

</div>

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