Skip to content

Commit 9852d24

Browse files
authored
Add info about the defaults values of index.sort.* settings (elastic#142877)
Fixes [elastic#56](elastic/docs-content-internal#56)
1 parent 2911363 commit 9852d24

File tree

1 file changed

+7
-1
lines changed
  • docs/reference/elasticsearch/index-settings

1 file changed

+7
-1
lines changed

docs/reference/elasticsearch/index-settings/sorting.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,20 @@ $$$index-sort-order$$$
8080
`index.sort.order` {applies_to}`serverless: all`
8181
: The sort order to use for each field. The order option can have the following values:
8282

83-
* `asc`: For ascending order
83+
* `asc`: For ascending order.
8484
* `desc`: For descending order.
8585

86+
When `index.sort.field` is set but `index.sort.order` is not explicitly provided, each field defaults to `asc`.
87+
8688
$$$index-sort-mode$$$
8789
`index.sort.mode` {applies_to}`serverless: all`
8890
: Elasticsearch supports sorting by multi-valued fields. The mode option controls what value is picked to sort the document. The mode option can have the following values:
8991

9092
* `min`: Pick the lowest value.
9193
* `max`: Pick the highest value.
9294

95+
When `index.sort.order` is set to `asc`, `index.sort.mode` defaults to `min`. If you set the order to `desc`, the mode defaults to `max`.
96+
9397

9498
$$$index-sort-missing$$$
9599
`index.sort.missing` {applies_to}`serverless: all`
@@ -98,6 +102,8 @@ $$$index-sort-missing$$$
98102
* `_last`: Documents without value for the field are sorted last.
99103
* `_first`: Documents without value for the field are sorted first.
100104

105+
Documents missing the sort field are always sorted last by default, regardless of sort order.
106+
101107

102108
::::{warning}
103109
Index sorting can be defined only once at index creation. It is not allowed to add or update a sort on an existing index. Index sorting also has a cost in terms of indexing throughput since documents must be sorted at flush and merge time. You should test the impact on your application before activating this feature.

0 commit comments

Comments
 (0)