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

View File

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

View File

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

View File

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

View File

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

View File

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