Browse Source

Docs: Document the `_doc` sort order.

Adrien Grand 10 years ago
parent
commit
7b878b5b5c
1 changed files with 5 additions and 1 deletions
  1. 5 1
      docs/reference/search/request/sort.asciidoc

+ 5 - 1
docs/reference/search/request/sort.asciidoc

@@ -3,7 +3,7 @@
 
 Allows to add one or more sort on specific fields. Each sort can be
 reversed as well. The sort is defined on a per field level, with special
-field name for `_score` to sort by score.
+field name for `_score` to sort by score, and `_doc` to sort by index order.
 
 [source,js]
 --------------------------------------------------
@@ -21,6 +21,10 @@ field name for `_score` to sort by score.
 }
 --------------------------------------------------
 
+NOTE: `_doc` has no real use-case besides being the most efficient sort order.
+So if you don't care about the order in which documents are returned, then you
+should sort by `_doc`. This especially helps when <<search-request-scroll,scrolling>>.
+
 ==== Sort Values
 
 The sort values for each document returned are also returned as part of