1
我跟着文档https://www.elastic.co/guide/en/elasticsearch/guide/current/multi-fields.html添加排序列为名称字段。不幸的是,它不工作elasticsearch排序意外的空返回
这些步骤如下:
- 附加索引映射
PUT /staff { "mappings": { "staff": { "properties": { "id": { "type": "string", "index": "not_analyzed" }, "name": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } } } } } }
- 添加文件
- 搜索为name.raw
POST /staff/list { "id": 5, "name": "abc" }
POST /staff_change/_search { "sort": "name.raw" }
然而,在响应排序字段返回空
"_source": {
"id": 5,
"name": "abc"
},
"sort": [
null
]
}
我不知道它为什么不工作,我不能搜索相关的问题文档相关此。是否有人遇到这个问题
提前感谢
啊哈,好去接谢谢:) –