elasticsearch Elasticsearch完成提示器中的数组输入
我试图弄明白为什么ES中的场景似乎对我不起作用。我有一个非常简单的建议映射设置:
elasticsearch Elasticsearch完成提示器中的数组输入,
elasticsearch,
elasticsearch,我试图弄明白为什么ES中的场景似乎对我不起作用。我有一个非常简单的建议映射设置: { "ding" : { "properties" : { "name" : { "type" : "string" }, "title" : { "type" : "string" }, "test" : { "type" : "string" }, "suggest": { "type": "completio
{
"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
} ]
}
您可能需要切换自动补全以使用标准分析仪