# Not analyze at (new) fields with all types in index

**URL:** <https://discuss.elastic.co/t/not-analyze-at-new-fields-with-all-types-in-index/64236>\
**Category:** Elasticsearch\
**Created:** [October 28, 2016, 4:41am UTC](https://discuss.elastic.co/t/not-analyze-at-new-fields-with-all-types-in-index/64236 "2016-10-28T04:41:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![birduser](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@birduser](https://discuss.elastic.co/u/birduser)\
**Post date:** [October 28, 2016, 4:41am UTC](https://discuss.elastic.co/t/not-analyze-at-new-fields-with-all-types-in-index/64236/1 "2016-10-28T04:41:19Z")

</div>

Hi,

I'm pretty new to elasticsearch and already archived some goals but now I stuck.

All existing fields and all ever created fields on a type in an Index should always not be indexed no matter the type (string etc.) of the field.

I need this for exact search results like when I have two entries "Foo bar" and "bar" and search for "bar" I just want the result "bar"

I thought it could work with a mapping like that:

```
type_name : {
       dynamic_templates : [{
		notanalyzed : {
			match: "*",
			mapping: {
				index: "not_analyzed"
			} 
		}
	}]
}

```

but it does not seem to work, I still find "foo bar" while searching for "bar". Any thoughts?

---

<div class="post-metadata">

**Author:** ![shanec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shanec/32/4004_2.png) [@shanec](https://discuss.elastic.co/u/shanec)\
**Post date:** [October 28, 2016, 1:26pm UTC](https://discuss.elastic.co/t/not-analyze-at-new-fields-with-all-types-in-index/64236/2 "2016-10-28T13:26:34Z")

</div>

You may be doing something like putting the docs into a different type/index or the docs are going into a different mapping based upon something overriding it. I've just copied your example and set up a sample document/query to [https://gist.github.com/eskibars/2a1e91454eb4fc4a88860cc80ea09acd](https://gist.github.com/eskibars/2a1e91454eb4fc4a88860cc80ea09acd) which works.

If you want to debug why it's not working, you might want to do a `GET /yourindex` to make sure `type_name` is set as you expected. You might also want to inspect the `_index` and `_type` at the result hits from a query you don't expect the documents to match on and see if they may not be added to the right index/type.

---

<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:08pm UTC](https://discuss.elastic.co/t/not-analyze-at-new-fields-with-all-types-in-index/64236/3 "2017-07-05T22:08:44Z")

</div>


