Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ElasticSearch--多字段的一个子字段中的值不正确_Python_Search_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch_Tokenize - Fatal编程技术网 elasticsearch,tokenize,Python,Search,elasticsearch,Tokenize" /> elasticsearch,tokenize,Python,Search,elasticsearch,Tokenize" />

Python ElasticSearch--多字段的一个子字段中的值不正确

Python ElasticSearch--多字段的一个子字段中的值不正确,python,search,elasticsearch,tokenize,Python,Search,elasticsearch,Tokenize,ElasticSearch使用“名称”的多字段为我的业务文档编制索引,以便我可以加权不同程度的名称匹配(精确匹配、多个单词中的一个等)。下面是我的映射中的一个片段 "name" : { "type" : "multi_field", "fields": { "name": {"type" : "string", "store" : "yes", "index_analyze

ElasticSearch使用“名称”的多字段为我的业务文档编制索引,以便我可以加权不同程度的名称匹配(精确匹配、多个单词中的一个等)。下面是我的映射中的一个片段

"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"
如果有人对此有任何想法,我将不胜感激


谢谢

它是可复制的还是只发生在这一个记录上?