CaoManhDat commented on a change in pull request #1395: SOLR-14365:
CollapsingQParser - Avoiding always allocate int[] and float[] with size equals
to number of unique values (WIP)
URL: https://github.com/apache/lucene-solr/pull/1395#discussion_r405219705
##########
File path:
solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java
##########
@@ -2258,29 +2215,20 @@ public void collapse(int collapseKey, int contextDoc,
int globalDoc) throws IOEx
final int idx;
if((idx = cmap.indexOf(collapseKey)) >= 0) {
int pointer = cmap.indexGet(idx);
- if(comp.test(currentVal, testValues[pointer])) {
- testValues[pointer]= currentVal;
- docs[pointer] = globalDoc;
+ if(comp.test(currentVal, testValues.get(pointer))) {
+ testValues.set(pointer, currentVal);
+ docs.set(pointer, globalDoc);
if(needsScores) {
- scores[pointer] = scorer.score();
+ scores.set(pointer, scorer.score());
}
}
} else {
++index;
cmap.put(collapseKey, index);
- if(index == testValues.length) {
- testValues = ArrayUtil.grow(testValues);
Review comment:
or we revert this change and handle it later?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]