Possible approaches for indexing field as both analyzed and not_analyzed

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?


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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d821a644-2206-42e1-b093-4f3cae95814d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.