# Not\_analyzed is not working

**URL:** <https://discuss.elastic.co/t/not-analyzed-is-not-working/71922>\
**Category:** Elasticsearch\
**Created:** [January 17, 2017, 11:51pm UTC](https://discuss.elastic.co/t/not-analyzed-is-not-working/71922 "2017-01-17T23:51:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![VuNguyen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vunguyen/32/14529_2.png) [@VuNguyen](https://discuss.elastic.co/u/VuNguyen)\
**Post date:** [January 17, 2017, 11:51pm UTC](https://discuss.elastic.co/t/not-analyzed-is-not-working/71922/1 "2017-01-17T23:51:17Z")

</div>

## Hi everyone, I am new to Elasticsearch, and using ES 5.1.1. When I create a Map for my type, I set property "index" of a text field to "not\_analyzed", but when I try to query document using term filter, it did not return any matched documents, or when I test the mapping, the text is split. Could anyone please help me out of this? Thanks in advance.

## **I create a mapping:** PUT /gb { "mappings": { "tweet": { "properties": { "tag": { "type": "text", "index": "not\_analyzed" } } } } }

**I add a document**  
PUT gb/tweet/1  
{  
"tag": "Black-cats"  
}

* * *

**I query document using term filter: return no documents**  
GET gb/tweet/\_search  
{  
"query": {  
"term": {  
"tag": "Black-cats"  
}  
}  
}

* * *

**I test the mapping: didn't return 1 term, but 2 (black, and cat)**  
GET gb/\_analyze  
{  
"field": "tag",  
"text": ["Black-cats"]  
}

---

<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:** [January 18, 2017, 6:01am UTC](https://discuss.elastic.co/t/not-analyzed-is-not-working/71922/2 "2017-01-18T06:01:39Z")

</div>

Try with type: keyword instead.

Index: not\_analyzed is deprecated but it should do the same thing. Might be a bug. [https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-index.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-index.html)

---

<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:** [February 15, 2017, 6:02am UTC](https://discuss.elastic.co/t/not-analyzed-is-not-working/71922/3 "2017-02-15T06:02:06Z")

</div>

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