Code cleanup

This commit is contained in:
Andrea Cavalli 2022-07-02 12:22:16 +02:00
parent 2a9427f0e4
commit 96d19c3e09
2 changed files with 6 additions and 11 deletions

View File

@ -757,6 +757,9 @@ public class LuceneUtils {
return QueryParams.of(query, 0, 0, NoSort.of(), false, Long.MAX_VALUE);
}
/**
* Rewrite a lucene query of a local searcher, then call the local searcher again with the rewritten query
*/
public static Mono<LuceneSearchResult> rewrite(LocalSearcher localSearcher,
Mono<LLIndexSearcher> indexSearcherMono,
LocalQueryParams queryParams,
@ -773,6 +776,9 @@ public class LuceneUtils {
}, LLUtils::finalizeResource);
}
/**
* Rewrite a lucene query of a multi searcher, then call the multi searcher again with the rewritten query
*/
public static Mono<LuceneSearchResult> rewriteMulti(MultiSearcher multiSearcher,
Mono<LLIndexSearchers> indexSearchersMono,
LocalQueryParams queryParams,

View File

@ -66,17 +66,6 @@ public class CountMultiSearcher implements MultiSearcher {
.doOnDiscard(LuceneSearchResult.class, SimpleResource::close), LLUtils::finalizeResource);
}
private LocalQueryParams getLocalQueryParams(LocalQueryParams queryParams) {
return new LocalQueryParams(queryParams.query(),
0L,
queryParams.offsetLong() + queryParams.limitLong(),
queryParams.pageLimits(),
queryParams.sort(),
queryParams.computePreciseHitsCount(),
queryParams.timeout()
);
}
@Override
public Mono<LuceneSearchResult> collect(Mono<LLIndexSearcher> indexSearcherMono,
LocalQueryParams queryParams,