Remove publishOn on lucene functions

This commit is contained in:
Andrea Cavalli 2022-10-13 00:15:57 +02:00
parent 1f672a63ef
commit d6f9398eff
6 changed files with 6 additions and 13 deletions

View File

@ -411,8 +411,7 @@ public class LuceneUtils {
if (preserveOrder) {
return hitsFlux
.publishOn(LuceneUtils.luceneScheduler())
.mapNotNull(hit -> mapHitBlocking(hit, indexSearchers, keyFieldName))
.publishOn(Schedulers.parallel());
.mapNotNull(hit -> mapHitBlocking(hit, indexSearchers, keyFieldName));
} else {
return hitsFlux
.buffer(Queues.XS_BUFFER_SIZE, () -> new ArrayList<Object>(Queues.XS_BUFFER_SIZE))
@ -434,8 +433,7 @@ public class LuceneUtils {
return (List<LLKeyScore>) (List<?>) shardHits;
}
}).subscribeOn(luceneScheduler()))
.flatMapIterable(a -> a)
.publishOn(Schedulers.parallel());
.flatMapIterable(a -> a);
}
}

View File

@ -81,7 +81,6 @@ public class CountMultiSearcher implements MultiSearcher {
LLUtils.ensureBlocking();
return (long) indexSearcher.getIndexSearcher().count(queryParams.query());
}).subscribeOn(luceneScheduler()), LLUtils::finalizeResource)
.publishOn(Schedulers.parallel())
.transform(TimeoutUtil.timeoutMono(queryParams.timeout()))
.map(count -> new LuceneSearchResult(TotalHitsCount.of(count, true), Flux.empty()));
}

View File

@ -61,8 +61,7 @@ public class DecimalBucketMultiSearcher {
return cmm.search(shard);
}).subscribeOn(luceneScheduler()))
.collectList()
.flatMap(results -> Mono.fromSupplier(() -> cmm.reduce(results)).subscribeOn(luceneScheduler()))
.publishOn(Schedulers.parallel());
.flatMap(results -> Mono.fromSupplier(() -> cmm.reduce(results)).subscribeOn(luceneScheduler()));
});
}
}

View File

@ -67,8 +67,7 @@ public class LuceneGenerator implements Supplier<ScoreDoc> {
return s;
}
)
.subscribeOn(SCHED)
.publishOn(Schedulers.parallel());
.subscribeOn(SCHED);
}
@Override

View File

@ -94,8 +94,7 @@ public class SortedScoredFullMultiSearcher implements MultiSearcher {
throw ex;
}
}).subscribeOn(luceneScheduler()))
)
.publishOn(Schedulers.parallel());
);
}
/**

View File

@ -106,8 +106,7 @@ public class StandardSearcher implements MultiSearcher {
}
return TopDocs.merge(0, queryParams.limitInt(), topDocs);
}
}).subscribeOn(luceneScheduler())))
.publishOn(Schedulers.parallel());
}).subscribeOn(luceneScheduler())));
}
/**