Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.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
<img src="//i.stack.imgur.com/RUiNP.png" height="16" width="18" alt="" class="sponsor tag img">elasticsearch Elasticsearch完成提示器中的数组输入_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch - Fatal编程技术网 elasticsearch Elasticsearch完成提示器中的数组输入,elasticsearch,elasticsearch" /> elasticsearch Elasticsearch完成提示器中的数组输入,elasticsearch,elasticsearch" />

elasticsearch Elasticsearch完成提示器中的数组输入

elasticsearch Elasticsearch完成提示器中的数组输入,elasticsearch,elasticsearch,我试图弄明白为什么ES中的场景似乎对我不起作用。我有一个非常简单的建议映射设置: { "ding" : { "properties" : { "name" : { "type" : "string" }, "title" : { "type" : "string" }, "test" : { "type" : "string" }, "suggest": { "type": "completio

我试图弄明白为什么ES中的场景似乎对我不起作用。我有一个非常简单的建议映射设置:

{
  "ding" : {
     "properties" : {
        "name" : { "type" : "string" },
        "title" : { "type" : "string" },
        "test" : { "type" : "string" },
        "suggest": {
            "type": "completion",
            "analyzer": "simple",
            "payloads": true,
            "max_input_length": 50
            }

        }
     }
}
并将这些文件编入索引,如下所示:

{
   "title": "Title",
   "name": "Name",
   "test": "Test",
   "suggest": {
      "input": [
         "Koolmees 21, Breda",
         "4822PP 21"
      ]
   }
}
完工后,建议在以下方面进行罚款:

{
    "ding" : {
      "text" : "Koo",
        "completion" : {
            "field" : "suggest"
        }
    }
}
但不是关于:

{
    "ding" : {
      "text" : "482",
        "completion" : {
            "field" : "suggest"
        }
    }
}

是因为输入以数字字符开头吗?我似乎无法理解:默认情况下,完成建议器使用
简单的
分析器。如果使用
Analyze
API,您可以看到它删除了以下数字:

curl -XGET 'localhost:9200/_analyze?analyzer=simple&pretty=true' -d '4822PP 21'
返回

{
    "tokens" : [ {
        "token" : "pp",
        "start_offset" : 4,
        "end_offset" : 6,
        "type" : "word",
        "position" : 1
   } ]
}

您可能需要切换自动补全以使用
标准分析仪