Compare commits
1 Commits
master
...
old-stable
Author | SHA1 | Date | |
---|---|---|---|
|
b90a78ef21 |
@ -356,11 +356,22 @@ public class LuceneUtils {
|
||||
return hitsFlux
|
||||
.buffer(Queues.XS_BUFFER_SIZE, () -> new ArrayList<Object>(Queues.XS_BUFFER_SIZE))
|
||||
.flatMap(shardHits -> Mono.fromCallable(() -> {
|
||||
for (int i = 0, size = shardHits.size(); i < size; i++) {
|
||||
shardHits.set(i, mapHitBlocking((ScoreDoc) shardHits.get(i), indexSearchers, keyFieldName));
|
||||
int i2 = 0;
|
||||
int size = shardHits.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
var el = mapHitBlocking((ScoreDoc) shardHits.get(i), indexSearchers, keyFieldName);
|
||||
if (el != null) {
|
||||
shardHits.set(i2, el);
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
if (i2 < size) {
|
||||
//noinspection unchecked
|
||||
return (List<LLKeyScore>) (List<?>) shardHits.subList(0, i2);
|
||||
} else {
|
||||
//noinspection unchecked
|
||||
return (List<LLKeyScore>) (List<?>) shardHits;
|
||||
}
|
||||
//noinspection unchecked
|
||||
return (List<LLKeyScore>) (List<?>) shardHits;
|
||||
}).subscribeOn(uninterruptibleScheduler(Schedulers.boundedElastic())))
|
||||
.flatMapIterable(a -> a)
|
||||
.publishOn(Schedulers.parallel());
|
||||
|
Loading…
x
Reference in New Issue
Block a user