Python ElasticSearch--多字段的一个子字段中的值不正确
ElasticSearch使用“名称”的多字段为我的业务文档编制索引,以便我可以加权不同程度的名称匹配(精确匹配、多个单词中的一个等)。下面是我的映射中的一个片段Python ElasticSearch--多字段的一个子字段中的值不正确,python,search,elasticsearch,tokenize,Python,Search,elasticsearch,Tokenize,ElasticSearch使用“名称”的多字段为我的业务文档编制索引,以便我可以加权不同程度的名称匹配(精确匹配、多个单词中的一个等)。下面是我的映射中的一个片段 "name" : { "type" : "multi_field", "fields": { "name": {"type" : "string", "store" : "yes", "index_analyze
"name" : {
"type" : "multi_field",
"fields": {
"name": {"type" : "string", "store" : "yes", "index_analyzer" : "AutoCompleteIndexAnalyzer", "search_analyzer" : "AutoCompleteSearchAnalyzer"},
"exact_match": {"type" : "string", "store" : "yes", "index_analyzer" : "ExactMatchNameIndexAnalyzer", "search_analyzer" : "ExactMatchNameSearchAnalyzer"},
"auto_name": {"type" : "string", "store" : "yes", "index_analyzer" : "keyword", "search_analyzer" : "keyword"},
}
},
因为它是一个多字段,所以我只提供一次值——ES只是对它进行多次分析
因此,我完全搞不懂“未中断”子字段如何得到一个完全不正确的值,而“名称”子字段是正确的。我不明白为什么精确匹配不起作用,所以我写了一个脚本字段,在搜索结果中为我提供“精确匹配”标记:
"exact_match_tokenized_name": [
"santininewyorkstyledeli"
],
"name": "Sal NY Pizza",
"name.auto_name": "Sal NY Pizza"
如果有人对此有任何想法,我将不胜感激
谢谢 它是可复制的还是只发生在这一个记录上?