August 2019
Intermediate to advanced
560 pages
13h 41m
English
The collapse parameter gives you a way to group search results according to different field values. It seems that the search results have collapsed. Then, only the first document for each field value is collected and returned in the response body.
Let's look at an example of finding the rating field value greater than, or equal to, 4, and collapse it with the rating field. In the following screenshot, you can see that the total matches are 103 in the response body, but only two results are returned. One document is rating=4, and the other is rating=5:
Read now
Unlock full access