我试图在ElasticSearch中为单个索引实现多个synonym_path
。
"settings": {
"index": {
"analysis": {
"analyzer": {
"synonym": {
"tokenizer": "whitespace",
"filter": ["synonym"]
}
},
"filter": {
"bool": {
"should": [{
"synonym": {
"type": "synonym",
"synonyms_path": "synonyms.txt",
"ignore_case": true
}},
{
"synonym": {
"type": "synonym",
"synonyms_path": "synonyms2.txt",
"ignore_case": true
}}]
}
}
}
}
},
"mappings": {
"animals": {
"properties": {
"name": {
"type": "String",
"analyzer": "synonym"
}
}
}
}
我在Chrome中使用JSON Sense尝试了上面的代码片段,但它生成了一个TokenFilter [bool] must have a type associated with it
错误。
有没有其他的方法来实现它?
1条答案
按热度按时间wtlkbnrh1#
analysis
区段中的filter
区段并不包含查询DSL,而是包含token filter定义。在您的情况下,需要使用以下设置重新创建索引: