fix crash
This commit is contained in:
parent
1c02a601bc
commit
67d3797df8
@ -793,15 +793,12 @@ public class LuceneUtils {
|
|||||||
LocalQueryParams queryParams,
|
LocalQueryParams queryParams,
|
||||||
String keyFieldName,
|
String keyFieldName,
|
||||||
GlobalQueryRewrite transformer) {
|
GlobalQueryRewrite transformer) {
|
||||||
return Mono.usingWhen(indexSearcherMono, indexSearcher -> {
|
return Mono.usingWhen(indexSearcherMono.map(LLIndexSearchers::unsharded), indexSearchers -> Mono
|
||||||
try (UnshardedIndexSearchers indexSearchers = LLIndexSearchers.unsharded(indexSearcher)) {
|
|
||||||
return Mono
|
|
||||||
.fromCallable(() -> transformer.rewrite(indexSearchers, queryParams))
|
.fromCallable(() -> transformer.rewrite(indexSearchers, queryParams))
|
||||||
.transform(LuceneUtils::scheduleLucene)
|
.transform(LuceneUtils::scheduleLucene)
|
||||||
.flatMap(queryParams2 ->
|
.flatMap(queryParams2 ->
|
||||||
localSearcher.collect(indexSearcherMono, queryParams2, keyFieldName, NO_REWRITE));
|
localSearcher.collect(indexSearcherMono, queryParams2, keyFieldName, NO_REWRITE)),
|
||||||
}
|
LLUtils::finalizeResource);
|
||||||
}, LLUtils::finalizeResource);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user