# Get the exact match value

**URL:** <https://discuss.elastic.co/t/get-the-exact-match-value/97238>\
**Category:** Elasticsearch\
**Created:** [August 16, 2017, 10:53am UTC](https://discuss.elastic.co/t/get-the-exact-match-value/97238 "2017-08-16T10:53:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jyoti\_Shukla](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@Jyoti\_Shukla](https://discuss.elastic.co/u/Jyoti_Shukla)\
**Post date:** [August 16, 2017, 10:53am UTC](https://discuss.elastic.co/t/get-the-exact-match-value/97238/1 "2017-08-16T10:53:06Z")

</div>

Hi,I wanted to know how to get the exact matched documents as I am getting approximate value matching ,like I have written query:  
{  
"query": {  
"nested": {  
"path": "Trips",  
"query": {  
"bool": {  
"must": [  
{  
"term": {  
"Trips.Employees.Source\_Geocode": "17.328375,78.587532"  
}  
},  
{  
"term": {  
"Trips.Employees.Source\_Geocode": "17.329349,78.595693"  
}  
}  
]  
}  
}  
}  
}  
}

but I am also getting value for 17.4523... like that.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 16, 2017, 1:14pm UTC](https://discuss.elastic.co/t/get-the-exact-match-value/97238/2 "2017-08-16T13:14:16Z")

</div>

is geocode a geo point? or a string? or a number array? What kind of field is this? Is it sufficient to just create a keyword field (which does not make much sense for any other kind of query like a range query). And what resembles an exact query/result set? If you had a couple of example documents (including mapping) this might be easier to follow and others are able to create a full reproduction.

---

<div class="post-metadata">

**Author:** ![Jyoti\_Shukla](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@Jyoti\_Shukla](https://discuss.elastic.co/u/Jyoti_Shukla)\
**Post date:** [August 16, 2017, 1:17pm UTC](https://discuss.elastic.co/t/get-the-exact-match-value/97238/3 "2017-08-16T13:17:18Z")

</div>

For now ,it is string.And for exact search means I want value which I have given to match .If it is not clear,let me know.Bdw ,thanks for the reply.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 16, 2017, 1:28pm UTC](https://discuss.elastic.co/t/get-the-exact-match-value/97238/4 "2017-08-16T13:28:31Z")

</div>

See my answer above. You can use a `keyword` field in the mapping for exact string matching and use a `term` filter.

---

<div class="post-metadata">

**Author:** ![Jyoti\_Shukla](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@Jyoti\_Shukla](https://discuss.elastic.co/u/Jyoti_Shukla)\
**Post date:** [August 16, 2017, 1:40pm UTC](https://discuss.elastic.co/t/get-the-exact-match-value/97238/5 "2017-08-16T13:40:47Z")

</div>

I used keyword ,still not getting the exact value.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 16, 2017, 1:43pm UTC](https://discuss.elastic.co/t/get-the-exact-match-value/97238/6 "2017-08-16T13:43:36Z")

</div>

If you dont share a full reproduction, it is basically impossible to help.

See [https://www.elastic.co/help](https://www.elastic.co/help)

---

<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:** [September 13, 2017, 1:43pm UTC](https://discuss.elastic.co/t/get-the-exact-match-value/97238/7 "2017-09-13T13:43:37Z")

</div>

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