Changed the getDocs() of SortedIntDocSet to return a wrapper class Do…#308
Changed the getDocs() of SortedIntDocSet to return a wrapper class Do…#308hiteshk25 wants to merge 4 commits intofs/branch_9_7from
Conversation
…cIdList, which could have an underlying 2d or 1d array
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on January 18
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| } else { | ||
| while ((docid = postingsEnum.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) { | ||
| docs[upto >> SortedIntDocSet.WORDS_SHIFT][upto++ & SortedIntDocSet.ARR_MASK] = docid; | ||
| docs.set(upto, docid); |
There was a problem hiding this comment.
Missing counter increment causes empty search results
High Severity
The upto counter is not incremented in the while loop at docs.set(upto, docid). The original code used upto++ in the array index expression, but during refactoring to use DocIdList.set(), the increment was accidentally dropped. Since upto determines the result size and is checked later (upto == 0 ? DocSet.empty() : ...), this causes all documents to be written to index 0 and the final result to be empty. This affects single-segment searches with small result sets.
2. DocIdList1d - mostly AI generated
…cIdList, which could have an underlying 2d or 1d array
https://issues.apache.org/jira/browse/SOLR-XXXXX
Description
Please provide a short description of the changes you're making with this pull request.
Solution
Please provide a short description of the approach taken to implement your solution.
Tests
Please describe the tests you've developed or run to confirm this patch implements the feature or solves the problem.
Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.Note
Modernizes small doc set storage and operations.
SortedIntDocSet.DocIdListabstraction with 1D and 2D implementations;SortedIntDocSetnow stores aDocIdListwith new helpers (allocate,build,grow,shrink,shrinkClone,zeroDocSet).DocSetBuilder,DocSetCollector,DocSetUtil,SolrIndexSearcher,JoinQuery, andKeepAliveRegeneratorto useDocIdList(get,set,copyTo) instead of rawint[][]access.LSBRadixSorterModto sortDocIdListand replaces previous sorter usage.intersection,andNot,binarySearch, iterators) toDocIdList.DocIdListimplementations.Written by Cursor Bugbot for commit 7468496. This will update automatically on new commits. Configure here.