我在ElasticSearch中打了个电话以获取特定的文档
{
"index" : appConfig.ElasticSearch.Module.index,
"type" : appConfig.ElasticSearch.Module.type,
"body" : {
"ids": modulesIds
}
}
如何在文档的某些“xyz”属性上对生成的文档进行排序?
最佳答案
我认为您无法做到。相反,如果您已经知道ID,为什么不这样做呢?
GET /my_index/_search
{
"query": {
"filtered": {
"filter": {
"ids": {
"values": [
"1","2","3"
]
}
}
}
},
"sort": [
{
"whatever": {
"order": "desc"
}
}
]
}
关于elasticsearch - ElasticSearch将排序属性添加到mget调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27622307/