我是 Elasticsearch 的新手。
我有文件,每个文件都有这样的结构:
{
"created_at": "2018-01-01 01:01:01",
"student": {
"first_name": "john",
"last_name": "doe"
},
"parent": {
"first_name": "susan",
"last_name": "smile"
}
}
我只想根据student.first_nameusing olivere/elasticpackage for对这些文档进行排序go。
这是我目前的查询:
searchSvc = searchSvc.SortBy(elastic.NewFieldSort("student.first_name").Asc())
我收到了这个错误:
弹性:错误 400(错误请求):所有分片都失败 [type=search_phase_execution_exception]
但是,当我尝试按 对它进行排序时created_at,它正在工作。
searchSvc = searchSvc.SortBy(elastic.NewFieldSort("created_at").Asc())
我在索引中没有任何映射。(这是问题吗?)
我尝试搜索类似“Elasticsearch 按嵌套对象排序”之类的内容,但我总是遇到需要对嵌套对象中的数组进行排序的问题。
冉冉说
相关分类