Undo parallelization of lucene searches

This commit is contained in:
Andrea Cavalli 2021-09-08 23:41:05 +02:00
parent 6926292904
commit 3a79e5ba6f

View File

@ -379,17 +379,9 @@ public class LuceneUtils {
.subscribeOn(scheduler)
);
} else {
return hitsFlux
.parallel()
.runOn(scheduler)
.map(hit -> {
var result = mapHitBlocking(hit, indexSearchers, keyFieldName);
// The "else" value is an errored key score, to filter out next
return Objects.requireNonNullElseGet(result, () -> new LLKeyScore(-1, -1, null));
})
.sequential()
// Filter out the errored key scores
.filter(ks -> !(ks.docId() == -1 && ks.score() == -1));
return hitsFlux.flatMap(hit -> Mono
.fromCallable(() -> mapHitBlocking(hit, indexSearchers, keyFieldName))
.subscribeOn(scheduler));
}
});
}