我试图调试我的同义词搜索。似乎当我使用Weetet格式并使用wn_s.pl文件时,它不起作用,但是当我使用自定义synonym.txt文件时,它起作用了。请让我知道我做错了。请找到下面的索引:
{
"settings": {
"index": {
"analysis": {
"filter": {
"synonym": {
"type": "synonym",
"format": "wordnet",
"synonyms_path": "analysis/wn_s.pl"
}
},
"analyzer": {
"synonym": {
"tokenizer": "standard",
"filter": ["lowercase",
"synonym"
]
}
},
"mappings": {
"properties": {
"firebaseId": {
"type": "text"
},
"name": {
"fielddata": true,
"type": "text",
"analyzer": "standard"
},
"name_auto": {
"type": "text"
},
"category_name": {
"type": "text",
"analyzer": "synonym"
},
"sku": {
"type": "text"
},
"price": {
"type": "text"
},
"magento_id": {
"type": "text"
},
"seller_id": {
"type": "text"
},
"square_item_id": {
"type": "text"
},
"square_variation_id": {
"type": "text"
},
"typeId": {
"type": "text"
}
}
}
}
}
}
}
我正在尝试对category_name进行同义词搜索,我有诸如鞋子和衣服之类的物品。当我搜索靴子,人字拖鞋或拖鞋时,什么都没有。
这是我的查询搜索:
{
"query": {
"match": {
"category_name": "flipflop"
}
}
}