Optimization

This commit is contained in:
Andrea Cavalli 2022-01-18 15:56:27 +01:00
parent dfce6cd725
commit adb490371f
2 changed files with 3 additions and 2 deletions

View File

@ -72,7 +72,7 @@ public class FastFacetsCollectorManager implements CollectorManager<FacetsCollec
@Override
public void collect(int doc) throws IOException {
if (hash.hashCode(doc) % collectionRate == 0) {
if (collectionRate == 1 || hash.hashCode(doc) % collectionRate == 0) {
leafCollector.collect(doc);
}
}

View File

@ -47,11 +47,12 @@ public class FastRandomSamplingFacetsCollector extends SimpleCollector implement
@Override
public void collect(int doc) throws IOException {
if (hash.hashCode(doc) % collectionRate == 0) {
if (collectionRate == 1 || hash.hashCode(doc) % collectionRate == 0) {
collector.collect(doc);
}
}
@Override
public ScoreMode scoreMode() {
return collector.scoreMode();