Sort Processor(排序处理器)

原文链接 : https://www.elastic.co/guide/en/elasticsearch/reference/5.3/sort-processor.html

译文链接 : http://www.apache.wiki/pages/viewpage.action?pageId=10028271

贡献者 : 那伊抹微笑ApacheCNApache中文网

array(数组)的 element(元素)给 ascending(升序) 或 descending(降序)排序。同类的 number(数值的)array(数组)会按 numerically(数字)来排序。而字符串数组或 string + number 这样混合的数组将会按字典顺序来排序。当字段不是 array(数组)时会抛出 error(错误)。

Table 31. Sort Options(表 31. 排序选项)

Name(名称) Required(必要的) Default(默认值) Description(描述)
field yes - 要被排序的 field(字段)
order no "asc" 用于排序的顺序。接受 “asc” 或 “desc
  1. {
  2. "sort": {
  3. "field": "field_to_sort",
  4. "order": "desc"
  5. }
  6. }