October 2019
Beginner
186 pages
5h 39m
English
This allows the search to collapse according to the field values. Choosing the top sorted document per collapse key will result in a collapse. In the following example, the best tweets per user are being retrieved and sorted by the number of likes:
GET /twitter/_search{ "query": { "match": { "message": "elasticsearch" } }, "collapse": { "field": "user" }, "sort": [ "likes" ], "from": 10}
In the preceding example, we are collapsing the user field.
Read now
Unlock full access