Add ensureBlocking in blocking method

This commit is contained in:
Andrea Cavalli 2021-10-07 00:54:20 +02:00
parent 013e4c5dd8
commit 81d8abe72c

View File

@ -177,12 +177,14 @@ public class ScoredSimpleLuceneShardSearcher implements LuceneMultiSearcher {
.flatMap(sharedManager -> Flux
.fromIterable(indexSearchers)
.flatMap(shard -> Mono.fromCallable(() -> {
LLUtils.ensureBlocking();
var collector = sharedManager.newCollector();
shard.search(queryParams.query(), collector);
return collector;
}))
.collectList()
.flatMap(collectors -> Mono.fromCallable(() -> {
LLUtils.ensureBlocking();
var pageTopDocs = sharedManager.reduce(collectors);
var pageLastDoc = LuceneUtils.getLastScoreDoc(pageTopDocs.scoreDocs);
long nextRemainingLimit;