elasticsearch 带标准分析仪和数字的Elasticsearch完成提示器
当我试图用标准分析器在完成字段上索引数字时,我遇到了一个错误 映射:elasticsearch 带标准分析仪和数字的Elasticsearch完成提示器,elasticsearch,elasticsearch,当我试图用标准分析器在完成字段上索引数字时,我遇到了一个错误 映射: PUT music { "mappings": { "_doc" : { "properties" : { "suggest" : { "type" : "completion", "analyzer": "standard" }
PUT music
{
"mappings": {
"_doc" : {
"properties" : {
"suggest" : {
"type" : "completion",
"analyzer": "standard"
}
}
}
}
}
索引:
PUT music/_doc/1?refresh
{
"suggest" : [ 1234, 5678 ]
}
这是我得到的错误:
[parsing_exception]未能解析[null]:预期的文本或对象,但获得了值\u NUMBER
我必须输入字符串吗?您只需将数字用双引号括起来(即作为字符串)
您只需将数字放在双引号中(即作为字符串)
数字值不会被分析,除非它们是字符串(文本)数字值不会被分析,除非它们是字符串(文本)
PUT music/_doc/1?refresh
{
"suggest" : [ "1234", "5678" ]
^ ^ ^ ^
| | | |
here and here
}