Template error Elasticsearch 2.4.2

I have a new index and I am trying to create the corresponding index and I am getting the following error
I am running Elasticsearch 2.4.2:

{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Field [aud_avs_p] cannot be analyzed and have doc values"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [logs]: Field [aud_avs_p] cannot be analyzed and have doc values","caused_by":{"type":"mapper_parsing_exception","reason":"Field [aud_avs_p] cannot be analyzed and have doc values"}

curl -XPUT localhost:9200/_template/mevents -d '
{
"template" : "mevents-*",
"settings" : {
"index.mapper.dynamic" : "false",
"index.number_of_replicas" : "1",
"index.number_of_shards" : "5"
},
"mappings" : {
"logs" : {
"properties" : {
"aud_avs_p" : {
"type" : "string",
"doc_values" : "true"
},
"aud_aops_p" : {
"type" : "long",
"doc_values" : "true"
},
"audience_id" : {
"index" : "not_analyzed",
"type" : "string",
"doc_values" : "true"
}
}
}
},
"aliases" : { }
}
}'

In 2.x, analyzed strings cannot also have doc values enabled. You'll have to either change that field to a not_analyzed string, or remove doc_values.

In 5.x, we introduce a distinction in how strings are specified with keyword / text. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/string.html for more details

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.