Mapping definition has unsupported parameters: search_analyzer, analyzer

I have one template in my production cluster that is not working. Whenever I post to create a new index with it I get:

POST ticket-me/doc/
{"admit_email": "example@example.com"}

{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Mapping definition for [admit_email] has unsupported parameters: [search_analyzer : standard] [analyzer : autocomplete]"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [doc]: Mapping definition for [admit_email] has unsupported parameters: [search_analyzer : standard] [analyzer : autocomplete]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "Mapping definition for [admit_email] has unsupported parameters: [search_analyzer : standard] [analyzer : autocomplete]"
}
},
"status": 400
}

If I change the name and the index-patterns to create a new template with the same configuration, that template works. The whole setup also works fine in my other cluster.

I'd appreciate any ideas.

Thanks.

The template is:

PUT _template/ticket
{
"index_patterns": [
"ticket-*"
],
"settings": {
"number_of_replicas": 0,
"number_of_shards": 1,
"analysis": {
"filter": {
"autocomplete_filter": {
"type": "edge_ngram",
"min_gram": 1,
"max_gram": 20
}
},
"analyzer": {
"autocomplete": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"autocomplete_filter"
]
}
}
},
"refresh_interval": "10s"
},
"mappings": {
"doc": {
"properties": {
"admit_name": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "standard"
},
"admit_email": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "standard"
},
"cart_id": {
"type": "keyword"
},
"cart_number": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "standard"
},
"event_name": {
"type": "keyword"
},
"event_session_id": {
"type": "keyword"
},
"event_template_id": {
"type": "keyword"
},
"extra": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "standard"
},
"identity_id": {
"type": "keyword"
},
"identity_name": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "standard"
},
"identity_email": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "standard"
},
"identity_extra": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "standard"
},
"membership_code": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "standard"
},
"message": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "standard"
},
"order_and_session": {
"type": "keyword"
},
"order_id": {
"type": "keyword"
},
"order_number": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "standard"
},
"order_extra": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "standard"
},
"order_survey": {
"type": "object"
},
"org_id": {
"type": "keyword"
},
"org_name": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "standard"
},
"org_extra": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "standard"
},
"purchased_on": {
"type": "date"
},
"relevant_at": {
"type": "date"
},
"scan_code": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "standard"
},
"seller_id": {
"type": "keyword"
},
"start_datetime": {
"type": "date"
},
"ticket_type_name": {
"type": "keyword"
},
"ticket_group_name": {
"type": "keyword"
}
}
}
}
}

Are there perhaps any other index templates registered with your production cluster? You could have another index template that causes the admit_email field to be mapped as for example a keyword field (which does not support analyzer and search_analyzer). That would explain the error you're seeing.

Can you post the output of GET _template on your production cluster here?

Thank you @abdon!!

There were two templates referencing the same index pattern! I've remove the second template and everything is working properly.

Thanks again,

Steven

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