Clarify first search API explanation of parameters (#21958)

Added info about the sort parameter and included the pretty parameter in the example.
This commit is contained in:
Matt Sicker 2016-12-12 08:00:27 -06:00 committed by Clinton Gormley
parent abf718832d
commit 32fcb7220e
1 changed files with 2 additions and 2 deletions

View File

@ -623,12 +623,12 @@ The REST API for search is accessible from the `_search` endpoint. This example
[source,js] [source,js]
-------------------------------------------------- --------------------------------------------------
GET /bank/_search?q=*&sort=account_number:asc GET /bank/_search?q=*&sort=account_number:asc&pretty
-------------------------------------------------- --------------------------------------------------
// CONSOLE // CONSOLE
// TEST[continued] // TEST[continued]
Let's first dissect the search call. We are searching (`_search` endpoint) in the bank index, and the `q=*` parameter instructs Elasticsearch to match all documents in the index. The `pretty` parameter, again, just tells Elasticsearch to return pretty-printed JSON results. Let's first dissect the search call. We are searching (`_search` endpoint) in the bank index, and the `q=*` parameter instructs Elasticsearch to match all documents in the index. The `sort=account_number:asc` parameter indicates to sort the results using the `account_number` field of each document in an ascending order. The `pretty` parameter, again, just tells Elasticsearch to return pretty-printed JSON results.
And the response (partially shown): And the response (partially shown):