Hi, I have a problem when I tried to index data with a synonyms that read from file, that is an mapper_exception which giving me error like this:
{
"error" : {
"root_cause" : [
{
"type" : "mapper_exception",
"reason" : "analyzer [synonym_analyzer] contains filters [my_synonyms] that are not allowed to run in all mode."
}
],
"type" : "mapper_parsing_exception",
"reason" : "Failed to parse mapping [doc]: analyzer [synonym_analyzer] contains filters [my_synonyms] that are not allowed to run in all mode.",
"caused_by" : {
"type" : "mapper_exception",
"reason" : "analyzer [synonym_analyzer] contains filters [my_synonyms] that are not allowed to run in all mode."
}
},
"status" : 400
}
My Environment is:
{
"name" : "Daruma-Precision-3630-Tower",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "zaS3v33FRy2lbR_fq-ND6Q",
"version" : {
"number" : "7.6.1",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "aa751e09be0a5072e8570670309b1f12348f023b",
"build_date" : "2020-02-29T00:15:25.529771Z",
"build_snapshot" : false,
"lucene_version" : "8.4.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
The Query that I used is:
PUT /laptops/?include_type_name=true
{
"settings": {
"index" : {
"analysis" : {
"filter" : {
"synonym_filter" : {
"type" : "synonym",
"synonyms" : [
"laptop, notebook",
"ram, memori"
]
},
"my_synonyms": {
"type": "synonym",
"synonyms_path": "my_synonyms.txt",
"updateable": true
}
},
"analyzer" : {
"synonym_analyzer" : {
"tokenizer" : "standard",
"filter" : ["lowercase", "synonym_filter"]
// "filter": ["my_synonyms"]
}
}
}
}
},
"mappings": {
"doc": {
"properties": {
"title": {
"type": "text",
"analyzer": "synonym_analyzer"
}
}
}
}
}
When I used synonyms that I hard coded in query it works and doesn't give me error..
Any advice or solutions to fix this? Thank you