ELK,萌萌哒

_id 排序问题

Elasticsearch | 作者 artisan | 发布于2019年05月30日 | 阅读数:1247

请教下 我们现在Search After分页,所以排序的时候 使用了唯一的字段_id (查看官方文档不推荐使用_id),查看了官网 推荐使用另外一个字段存放_id的值 开启doc_values , 请问如何实现这个? 再次感谢
copy_of__id.png
已邀请:

bellengao - 博客: https://www.jianshu.com/u/e0088e3e2127

赞同来自: artisan

使用pipeline, 在写数据时指定使用该pipeline
PUT _ingest/pipeline/test
{
"description" : "test",
"processors" : [
{
"set" : {
"field": "uid",
"value": "{{_id}}"
}
}
]
}

要回复问题请先登录注册