Optimization
This commit is contained in:
parent
f157e67818
commit
c47f45076a
@ -7,6 +7,7 @@ import static it.cavallium.dbengine.lucene.searcher.PaginationInfo.MAX_SINGLE_SE
|
||||
import it.cavallium.dbengine.database.LLKeyScore;
|
||||
import it.cavallium.dbengine.lucene.LuceneUtils;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
import org.apache.lucene.search.IndexSearcher;
|
||||
import org.apache.lucene.search.ScoreDoc;
|
||||
@ -93,8 +94,9 @@ public class SimpleLuceneLocalSearcher implements LuceneLocalSearcher {
|
||||
s -> {}
|
||||
)
|
||||
.subscribeOn(scheduler)
|
||||
.flatMapSequential(topFieldDoc -> LuceneUtils.convertHits(Flux.fromArray(topFieldDoc.scoreDocs),
|
||||
IndexSearchers.unsharded(indexSearcher), keyFieldName, scheduler, true), 2)
|
||||
.flatMapIterable(topDocs -> Arrays.asList(topDocs.scoreDocs))
|
||||
.transform(topFieldDocFlux -> LuceneUtils.convertHits(topFieldDocFlux,
|
||||
IndexSearchers.unsharded(indexSearcher), keyFieldName, scheduler, true))
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ import it.cavallium.dbengine.lucene.LuceneUtils;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
@ -127,8 +128,9 @@ class UnscoredPagedLuceneShardSearcher implements LuceneShardSearcher {
|
||||
}
|
||||
)
|
||||
.subscribeOn(scheduler)
|
||||
.flatMapSequential(topFieldDoc -> LuceneUtils.convertHits(Flux.fromArray(topFieldDoc.scoreDocs),
|
||||
indexSearchers, keyFieldName, scheduler, false), 2)
|
||||
.flatMapIterable(topDocs -> Arrays.asList(topDocs.scoreDocs))
|
||||
.transform(scoreDocsFlux -> LuceneUtils.convertHits(scoreDocsFlux,
|
||||
indexSearchers, keyFieldName, scheduler, false))
|
||||
.transform(flux -> {
|
||||
if (paginationInfo.forceSinglePage()
|
||||
|| paginationInfo.totalLimit() - paginationInfo.firstPageLimit() <= 0) {
|
||||
|
@ -164,7 +164,8 @@ public class UnscoredUnsortedContinuousLuceneMultiSearcher implements LuceneMult
|
||||
}
|
||||
return null;
|
||||
}).thenMany(scoreDocsSink.asFlux());
|
||||
var resultsFlux = LuceneUtils.convertHits(scoreDocsFlux, indexSearchers, keyFieldName, scheduler, false);
|
||||
var resultsFlux = LuceneUtils
|
||||
.convertHits(scoreDocsFlux, indexSearchers, keyFieldName, scheduler, false);
|
||||
|
||||
return new LuceneSearchResult(TotalHitsCount.of(0, false), resultsFlux, release);
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user