typesense
typesense copied to clipboard
fix(index): correct curation handling in group-by queries
TLDR
Fixes curated_topster initialization to properly handle group-by first pass.
Change Summary
Bug Fixes:
-
In
src/index.cpp:-
Index::search(): Fixedcurated_topsterinitialization on line 3447 to useis_group_by_first_passparameter instead of hardcodedfalse - This ensures curated results are properly handled during the first pass of group-by operations
-
Test Coverage:
-
In
test/collection_override_test.cpp:-
CurationWithGroupBy(): Added new test method to verify curation works correctly with group-by queries - Tests both regular search and group-by search scenarios with pinned documents
- Validates that curated documents maintain their
curatedflag in grouped results
-
Context
The bug occurred when using curation (pinned documents) with group-by queries. The curated_topster was being initialized with false for the group-by first pass parameter, causing curated results to not be properly handled during grouped searches. This fix ensures that both the main topster and curated_topster use the same is_group_by_first_pass parameter, maintaining consistency in how results are processed and ensuring curated documents appear correctly in grouped search results.
PR Checklist
- [x] I have read and signed the Contributor License Agreement.