Skip to content

Commit 9291b9b

Browse files
committed
HSEARCH-3661 Do not collect counts in Lucene's range collectors
if needed that would get collected by the collectors/managers etc
1 parent 916fd41 commit 9291b9b

File tree

2 files changed

+0
-14
lines changed
  • backend/lucene/src/main/java/org/hibernate/search/backend/lucene/lowlevel/collector/impl
  • lucene-next/backend/lucene/src/main/java/org/hibernate/search/backend/lucene/lowlevel/collector/impl

2 files changed

+0
-14
lines changed

backend/lucene/src/main/java/org/hibernate/search/backend/lucene/lowlevel/collector/impl/RangeCollector.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public class RangeCollector extends SimpleCollector {
3333
private final long[] boundaries;
3434
private final IntArrayList[] countsPerBoundaries;
3535

36-
private final long[] counts;
3736
private final Collector[][] collectors;
3837
private final CollectorKey<?, ?>[] keys;
3938
private final LeafCollector[][] leafCollectors;
@@ -138,7 +137,6 @@ else if ( flags == 1 ) {
138137
}
139138
}
140139

141-
counts = new long[ranges.length];
142140
leafCollectors = new LeafCollector[keys.length][];
143141
for ( int i = 0; i < leafCollectors.length; i++ ) {
144142
leafCollectors[i] = new LeafCollector[ranges.length];
@@ -147,7 +145,6 @@ else if ( flags == 1 ) {
147145

148146
private void processLeafWithIndex(int index, int doc) throws IOException {
149147
for ( IntCursor cursor : countsPerBoundaries[index] ) {
150-
counts[cursor.value]++;
151148
for ( int i = 0; i < keys.length; i++ ) {
152149
leafCollectors[i][cursor.value].collect( doc );
153150
}
@@ -193,10 +190,6 @@ public void collect(int doc) throws IOException {
193190
}
194191
}
195192

196-
public long[] counts() {
197-
return counts;
198-
}
199-
200193
public Collector[][] collectors() {
201194
return collectors;
202195
}

lucene-next/backend/lucene/src/main/java/org/hibernate/search/backend/lucene/lowlevel/collector/impl/RangeCollector.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public class RangeCollector extends SimpleCollector {
3333
private final long[] boundaries;
3434
private final IntArrayList[] countsPerBoundaries;
3535

36-
private final long[] counts;
3736
private final Collector[][] collectors;
3837
private final CollectorKey<?, ?>[] keys;
3938
private final LeafCollector[][] leafCollectors;
@@ -138,7 +137,6 @@ else if ( flags == 1 ) {
138137
}
139138
}
140139

141-
counts = new long[ranges.length];
142140
leafCollectors = new LeafCollector[keys.length][];
143141
for ( int i = 0; i < leafCollectors.length; i++ ) {
144142
leafCollectors[i] = new LeafCollector[ranges.length];
@@ -147,7 +145,6 @@ else if ( flags == 1 ) {
147145

148146
private void processLeafWithIndex(int index, int doc) throws IOException {
149147
for ( IntCursor cursor : countsPerBoundaries[index] ) {
150-
counts[cursor.value]++;
151148
for ( int i = 0; i < keys.length; i++ ) {
152149
leafCollectors[i][cursor.value].collect( doc );
153150
}
@@ -193,10 +190,6 @@ public void collect(int doc) throws IOException {
193190
}
194191
}
195192

196-
public long[] counts() {
197-
return counts;
198-
}
199-
200193
public Collector[][] collectors() {
201194
return collectors;
202195
}

0 commit comments

Comments
 (0)