原文链接 : https://www.elastic.co/guide/en/elasticsearch/reference/5.3/sort-processor.html
译文链接 : http://www.apache.wiki/pages/viewpage.action?pageId=10028271
贡献者 : [那伊抹微笑],[ApacheCN],[Apache中文网]
将 array(数组)的 element(元素)给 ascending(升序) 或 descending(降序)排序。同类的 number(数值的)array(数组)会按 numerically(数字)来排序。而字符串数组或 string + number 这样混合的数组将会按字典顺序来排序。当字段不是 array(数组)时会抛出 error(错误)。
Name(名称) | Required(必要的) | Default(默认值) | Description(描述) |
---|---|---|---|
field | yes | - | 要被排序的 field(字段) |
order | no | "asc" | 用于排序的顺序。接受 “asc” 或 “desc” |
{
"sort": {
"field": "field_to_sort",
"order": "desc"
}
}
内容来源于网络,如有侵权,请联系作者删除!