Docs: Document the `_doc` sort order.

This commit is contained in:
Adrien Grand 2015-08-24 15:37:30 +02:00
parent 9112217869
commit 7b878b5b5c
1 changed files with 5 additions and 1 deletions

View File

@ -3,7 +3,7 @@
Allows to add one or more sort on specific fields. Each sort can be 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 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] [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 ==== Sort Values
The sort values for each document returned are also returned as part of The sort values for each document returned are also returned as part of