Hi,

I collect performance data into ES and my indices are named in a form 
"prefix_<date-string>" in order to delete old data efficiently. For all 
those indices and all types within them, I'd like to have string fields 
not_analyzed and exact matched in searches. My issue is that indices are 
created by first index request to them, so I cannot easily preset the 
analyzers via mappers. I've tried to use global templates as:

POST http://localhost:9200/_template/t2

{
    "template" : "z*",
    "mapping" : {
         "type" : "string",
         "index" : "not_analyzed"
    }
}

which seems to be taken into consideration when the index is created, but 
still, for filtered query like:

{
  "query": {
  "filtered" : {
    "filter" : {
    "bool" : {
    "must" : [
    {"term" : {"path4" : "BASE"}},
    {"term" : {"path3" : "vm-609"}}
        ]
             }
         }
      }
   }
}

I'm not getting any document while for query_string query like:
{
   "query" : {
   "query_string" : {
        "query" : "path3:\"vm-609\" AND path4:\"BASE\""
    }
    }
}

I'm getting the expected results. 

So my question is, how to disable string field analysis in order to be able 
to use filtered queries for all in future created indices whose names 
follow my pattern "prefix_<date-string>"



-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/0ae751d3-fc67-42a1-8130-d8116398b7ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to