# Possible approaches for indexing field as both analyzed and not\_analyzed

**URL:** <https://discuss.elastic.co/t/possible-approaches-for-indexing-field-as-both-analyzed-and-not-analyzed/23450>\
**Category:** Elasticsearch\
**Created:** [April 28, 2015, 7:26pm UTC](https://discuss.elastic.co/t/possible-approaches-for-indexing-field-as-both-analyzed-and-not-analyzed/23450 "2015-04-28T19:26:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marinoc](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@marinoc](https://discuss.elastic.co/u/marinoc)\
**Post date:** [April 28, 2015, 7:26pm UTC](https://discuss.elastic.co/t/possible-approaches-for-indexing-field-as-both-analyzed-and-not-analyzed/23450/1 "2015-04-28T19:26:39Z")

</div>

We have a State field in our documents that contains the full name of a  
U.S. state or territory. We want to use it as a filter w some queries, but  
we also want the names of states to be searchable via full text searches.  
Thus, we know we'll need to have multiple versions of this field - one that  
is analyzed/tokenized for full text searches and one that is not analyzed  
for filtering.

Our first option is to set the State field as "not\_analyzed" and use the  
\_all field for full text searches.

Our second option is to leverage multi fields (State, State.raw) and map  
the State field like:

"State" : {  
"type" : "string",  
"index" : "analyzed",  
"fields" : {  
"raw" : {"type" : "string", "index" : "not\_analyzed"}  
}  
}

Are there any considerations we need to take into account before going w  
one over the other?

Thanks,  
Chris

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d821a644-2206-42e1-b093-4f3cae95814d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d821a644-2206-42e1-b093-4f3cae95814d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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/possible-approaches-for-indexing-field-as-both-analyzed-and-not-analyzed/23450/2 "2017-07-06T00:17:15Z")

</div>

Closed on July 6, 2017, 12:17am UTC


