【发布时间】:2016-03-07 11:01:10
【问题描述】:
我按照文档https://www.elastic.co/guide/en/elasticsearch/guide/current/multi-fields.html 为 name 字段添加了排序列。不幸的是,它不起作用
这些是步骤:
- 添加索引映射
PUT /staff { "mappings": { "staff": { "properties": { "id": { "type": "string", "index": "not_analyzed" }, "name": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } } } } } }
- 添加文档
POST /staff/list { "id": 5, "name": "abc" }
- 搜索 name.raw
POST /staff_change/_search { "sort": "name.raw" }
但是,响应中的排序字段返回 null
"_source": {
"id": 5,
"name": "abc"
},
"sort": [
null
]
}
我不知道为什么它不起作用,我无法搜索与此相关的相关问题文档。有人遇到过这个问题吗
在此先感谢
【问题讨论】:
标签: elasticsearch