Grouping documents breaks pagination & more
See original GitHub issueThe grouping features seems to break pagination, total results, and results per page when using the Reference UI or Search UI.
To reproduce, download the Reference UI/Search UI and apply a grouping rule to one of the fields:
"group": { "field": "doc_group" }
The total results, and results per page sections represent the amount results had they not been grouped together, I think this is a little misleading as the amount of visible documents would be considerably less.
The pagination has the same issue. Due to the app thinking there are more results to be shown, it calculates more pages than you need, then some of the pages show blank as there actually aren’t that many results.
Digging further, I have noticed that when using the grouping feature it won’t return any more than 100 results, as opposed to the 1000 allowed when not using the grouping feature.
When making a search I am receiving “172” as the totalResults value, however I can only view 100 of them. If I set the results to 200 per page, the totalResults comes through as 172, but the amount of actual results being returned by the API is still 100.
Changing the size field on the group doesn’t seem to affect this.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (6 by maintainers)
@XigeTime Hey! Glad you got it working.
Curations will not currently work with grouping. I will ask around about a workaround.
If you go through support and file a bug or Enhancement Request with them, they will create a request with a tracking number which you will be able to follow. I would not expect a very fast turnaround for this particular issue though.
Hey @XigeTime,
This is actually a known issue in App Search. Unfortunately, with the current “group” implementation, paging and sorting are both known to break or behave unexpectedly.
I do have a temporary solution for you. Add “collapse: true” in your group configuration:
This should fix the issue you are experiencing with paging and sorting.
** There is one caveat to this ** - If the doc_group field you are grouping on can have multiple values, the field collapsing will not work correctly. You must ensure that documents have one single values for
doc_group
.Let me know if this helps!