Also asked on StackOverflow
I'm using version 7.7 of ElasticSearch, LogStash and Kibana and trying to update an index mapping for a field is resulting in one of 2 errors:
mapper_parsing_exception: analyzer on field [title] must be set when search_analyzer is set
illegal_argument_exception: Mapper for [title] conflicts with existing mapping:\n[mapper [title] has different [analyzer]]
Here is the operation that I am attempting. If I remove "analyzer": "standard"
, I get the first error. If I leave it in, I get the second error.
PUT /my_index/_mapping
{
"properties": {
"title": {
"type": "text",
"analyzer": "standard",
"search_analyzer": "synonyms"
}
}
}
However when I get the mapping with GET /my_index/_mapping
, I don't see any analyzer defined:
"title" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
Extra Info
Here is how I setup the "synonyms" search analyzer, but I don't think that is relevant:
POST /my_index/_close
PUT /my_index/_settings
{
"index": {
"analysis": {
"analyzer": {
"synonyms": {
"tokenizer": "whitespace",
"filter": [
"lowercase",
"the_synonyms"
]
}
},
"filter": {
"the_synonyms": {
"type": "synonym",
"synonyms_path": "the_synonyms.txt",
"updateable": true
}
}
}
}
}
POST /my_index/_open