# Elasticsearch (2.3.4), ignores not\_analyzed even though inserted during index creation

**URL:** <https://discuss.elastic.co/t/elasticsearch-2-3-4-ignores-not-analyzed-even-though-inserted-during-index-creation/63800>\
**Category:** Elasticsearch\
**Created:** [October 24, 2016, 8:32pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-4-ignores-not-analyzed-even-though-inserted-during-index-creation/63800 "2016-10-24T20:32:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Lee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_lee/32/12693_2.png) [@Daniel\_Lee](https://discuss.elastic.co/u/Daniel_Lee)\
**Post date:** [October 24, 2016, 8:32pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-4-ignores-not-analyzed-even-though-inserted-during-index-creation/63800/1 "2016-10-24T20:32:04Z")

</div>

created a new index along with the following mapping that turns off analysis.

```
curl -XPUT localhost:9200/vacation/ -d 
     '{ "mappings": 
          { "rentals": 
               { "properties": 
                     { "name": { "type": "string", "index": "not_analyzed" }} 
               }
          }
       }'

```

This request is acknowledged and I inserted a new document called in the index:

`{ "name": "fire house" }`  
Since analysis is turned off, the document name, "fire house", shouldn't be tokenized. So unless the query is exactly "fire house," the document shouldn't be retrieved. However, the document is being retrieved even though the query term is just "fire" or "house." Could this be an issue with the current version of E.S. I'm using or is it the way I specified mapping during index creation?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [October 25, 2016, 2:19am UTC](https://discuss.elastic.co/t/elasticsearch-2-3-4-ignores-not-analyzed-even-though-inserted-during-index-creation/63800/2 "2016-10-25T02:19:26Z")

</div>

Could you show how to index your data?

FYI: you can see how it works analyzers and field using [\_analyze API](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-analyze.html)

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 25, 2016, 2:24am UTC](https://discuss.elastic.co/t/elasticsearch-2-3-4-ignores-not-analyzed-even-though-inserted-during-index-creation/63800/3 "2016-10-25T02:24:39Z")

</div>

This field would by default be included in the \_all field, which is analysed. Do you specify the field name in your query?

---

<div class="post-metadata">

**Author:** ![Daniel\_Lee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_lee/32/12693_2.png) [@Daniel\_Lee](https://discuss.elastic.co/u/Daniel_Lee)\
**Post date:** [October 25, 2016, 6:03pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-4-ignores-not-analyzed-even-though-inserted-during-index-creation/63800/4 "2016-10-25T18:03:28Z")

</div>

I'm just applying this command:

`post localhost:9200/vacation/rentals/1 -d '{ "name": "fire house"}'`

---

<div class="post-metadata">

**Author:** ![Daniel\_Lee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_lee/32/12693_2.png) [@Daniel\_Lee](https://discuss.elastic.co/u/Daniel_Lee)\
**Post date:** [October 26, 2016, 4:55pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-4-ignores-not-analyzed-even-though-inserted-during-index-creation/63800/5 "2016-10-26T16:55:05Z")

</div>

Hello Christian, this what I entered in my search query { { "term" : { "name" : "fire" } }}. I specified the name field as you can tell, and yet the document with the name "fire house" continues to be retrieved.

---

<div class="post-metadata">

**Author:** ![Daniel\_Lee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_lee/32/12693_2.png) [@Daniel\_Lee](https://discuss.elastic.co/u/Daniel_Lee)\
**Post date:** [October 26, 2016, 7:00pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-4-ignores-not-analyzed-even-though-inserted-during-index-creation/63800/6 "2016-10-26T19:00:50Z")

</div>

Christian, I tried the search query again with field match, and it finally worked. It's strange, the first time I tried it didn't work. But now it does 🙂

---

<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 5, 2017, 10:09pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-4-ignores-not-analyzed-even-though-inserted-during-index-creation/63800/7 "2017-07-05T22:09:22Z")

</div>


