# Finding exact value with hyphen on not analyzed field is not working

**URL:** <https://discuss.elastic.co/t/finding-exact-value-with-hyphen-on-not-analyzed-field-is-not-working/23459>\
**Category:** Elasticsearch\
**Created:** [April 29, 2015, 6:53am UTC](https://discuss.elastic.co/t/finding-exact-value-with-hyphen-on-not-analyzed-field-is-not-working/23459 "2015-04-29T06:53:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![asmierzchalski](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@asmierzchalski](https://discuss.elastic.co/u/asmierzchalski)\
**Post date:** [April 29, 2015, 6:53am UTC](https://discuss.elastic.co/t/finding-exact-value-with-hyphen-on-not-analyzed-field-is-not-working/23459/1 "2015-04-29T06:53:24Z")

</div>

Hello together,

i'm using Logstash in combination with ElasticSearch. I have a field from type String which is not\_analyzed. The values are containing hyphens. When i'm trying to filter with a term for this field and that value i'm not getting any results.

After reading [http://www.elastic.co/guide/en/elasticsearch/guide/master/\_finding\_exact\_values.html](http://www.elastic.co/guide/en/elasticsearch/guide/master/_finding_exact_values.html) i guess this should be possible. I tried the example from this answer [http://stackoverflow.com/questions/11566838/elastic-search-hyphen-issue-with-term-filter](http://stackoverflow.com/questions/11566838/elastic-search-hyphen-issue-with-term-filter) and it's working, so i'm not sure where the problem with the index from Logstash or my Filter is.

Field description in the index:  
"objectId":{"type":"string","norms":{"enabled":false},"fields":{"raw{"type":"string","index":"not\_analyzed","ignore\_above":256}}}

My filter query:  
curl -XGET [http://localhost:9200/\_all/\_search](http://localhost:9200/_all/_search) -d '{  
"filter" : {  
"term" : {  
"objectId" : "8c9a3c20-744e-44d7-8467-621a9b461002"  
}  
}  
}'

---

<div class="post-metadata">

**Author:** ![asmierzchalski](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@asmierzchalski](https://discuss.elastic.co/u/asmierzchalski)\
**Post date:** [April 29, 2015, 9:14am UTC](https://discuss.elastic.co/t/finding-exact-value-with-hyphen-on-not-analyzed-field-is-not-working/23459/2 "2015-04-29T09:14:36Z")

</div>

I've found the solution myself. Logstash provides the fields analyzed and not\_analyzed in the .raw field.  
So i only have to query the objectId.raw field.

---

<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 6, 2017, 12:17am UTC](https://discuss.elastic.co/t/finding-exact-value-with-hyphen-on-not-analyzed-field-is-not-working/23459/3 "2017-07-06T00:17:08Z")

</div>


