Ashutosh Thakur
05/10/2025, 1:02 PM/multi_search
endpoint and group_by
set to supplierInfo
to group results. My query searches for specific `rootPartNumber`s and filters where familyQuantity > 0
.
I want to:
• Get up to 250 groups (suppliers) per page using per_page: 250
• For each group, I want to receive up to 100 hits (records), using limit: 100
• I sort by _group_found:desc
to get the most relevant or populated groups first.
The issue is:
• When I set per_page: 250
, no hits are returned.
• When I set per_page: 10
, I start getting hits, but not sorted properly.
Expected Behavior:
• When I request per_page: 250
, I should get up to 250 groups.
• Within each group, up to 100 hits (filtered and sorted) should be present.
• Sorting should respect _group_found:desc
.
respected bode of query :
{
"searches": [
{
"query_by": "rootPartNumber",
"per_page": 1,
"limit": 1000,
"highlight_full_fields": "rootPartNumber",
"collection": "supplierinventories_rpn",
"q": "*",
"filter_by": "(rootPartNumber:=[68001M79G00,68002M79G00,68003M79G00,68004M79G00,57300M66L00,84511M79G20,71711M66L00-5PK,71741M66L00-5PK,71732M66L10-5PK,71731M66L10-5PK,35501M66L00,35502M66L00,35121M66L00,35321M66L00,84611M76G00,35650M66L00,35750M66L00,83811M77G00,83821M77G00,83831M77G00,83841M77G00,72321M66L00,72322M66L00,72331M76G00-5PK,990J0M66L00-010,71781M66L00,71782M66L00,990J0M66L01-010,990J0M66LQ0-010,43250M79G50-27N] && familyQuantity:>0)",
"max_facet_values": 100,
"group_by": "supplierInfo",
"sort_by": "_group_found:desc",
"facet_by": "supplierInfo",
"page": 5,
"group_limit": 99
}
]
}
Can u please help me solve this problem?
Reference talking on group sorting.