Update tests

This commit is contained in:
Andrea Cavalli 2022-02-11 21:46:05 +01:00
parent f478ea97cd
commit 4f52b3d542
3 changed files with 12 additions and 22 deletions

View File

@ -1,11 +1,9 @@
package it.cavallium.dbengine.lucene.searcher;
import it.cavallium.dbengine.lucene.MaxScoreAccumulator;
import java.util.Iterator;
import java.util.List;
import java.util.function.Supplier;
import java.util.stream.IntStream;
import org.apache.lucene.search.CustomHitsThresholdChecker;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.ScoreDoc;
@ -14,17 +12,14 @@ public class LuceneMultiGenerator implements Supplier<ScoreDoc> {
private final Iterator<Supplier<ScoreDoc>> generators;
private Supplier<ScoreDoc> luceneGenerator;
public LuceneMultiGenerator(List<IndexSearcher> shards,
LocalQueryParams localQueryParams,
CustomHitsThresholdChecker hitsThresholdChecker) {
public LuceneMultiGenerator(List<IndexSearcher> shards, LocalQueryParams localQueryParams) {
this.generators = IntStream
.range(0, shards.size())
.mapToObj(shardIndex -> {
IndexSearcher shard = shards.get(shardIndex);
return (Supplier<ScoreDoc>) new LuceneGenerator(shard,
localQueryParams,
shardIndex,
hitsThresholdChecker
shardIndex
);
})
.iterator();

View File

@ -64,7 +64,7 @@ public class UnsortedStreamingMultiSearcher implements MultiSearcher {
return Flux.fromIterable(shards).index().flatMap(tuple -> {
var shardIndex = (int) (long) tuple.getT1();
var shard = tuple.getT2();
return LuceneGenerator.reactive(shard, localQueryParams, shardIndex, hitsThreshold);
return LuceneGenerator.reactive(shard, localQueryParams, shardIndex);
});
});
}

View File

@ -1,7 +1,6 @@
package it.cavallium.dbengine.lucene.searcher;
import it.cavallium.dbengine.lucene.ExponentialPageLimits;
import it.cavallium.dbengine.lucene.MaxScoreAccumulator;
import it.unimi.dsi.fastutil.longs.LongList;
import java.io.IOException;
import java.time.Duration;
@ -67,11 +66,10 @@ public class LuceneGeneratorTest {
limit,
pageLimits,
null,
true,
null,
Duration.ofDays(1)
),
-1,
limitThresholdChecker
-1
);
var results = fixResults(reactiveGenerator.collectList().block());
@ -92,12 +90,11 @@ public class LuceneGeneratorTest {
0L,
0,
pageLimits,
Sort.RELEVANCE,
true,
null,
null,
Duration.ofDays(1)
),
-1,
limitThresholdChecker
-1
);
var results = reactiveGenerator.collectList().block();
@ -116,11 +113,10 @@ public class LuceneGeneratorTest {
limit,
pageLimits,
null,
true,
null,
Duration.ofDays(1)
),
-1,
limitThresholdChecker
-1
);
var results = reactiveGenerator.collectList().block();
@ -142,11 +138,10 @@ public class LuceneGeneratorTest {
limit,
pageLimits,
null,
true,
null,
Duration.ofDays(1)
),
-1,
limitThresholdChecker
-1
);
var results = fixResults(reactiveGenerator.collectList().block());