parent
32fa90c9ba
commit
04fabead14
|
@ -377,11 +377,12 @@ public class SearchService extends AbstractLifecycleComponent implements IndexEv
|
||||||
// entirely. Otherwise we fork the execution in the search thread pool.
|
// entirely. Otherwise we fork the execution in the search thread pool.
|
||||||
ShardSearchRequest canMatchRequest = new ShardSearchRequest(orig);
|
ShardSearchRequest canMatchRequest = new ShardSearchRequest(orig);
|
||||||
try (Engine.Searcher searcher = shard.acquireCanMatchSearcher()) {
|
try (Engine.Searcher searcher = shard.acquireCanMatchSearcher()) {
|
||||||
QueryShardContext context = indexService.newQueryShardContext(request.shardId().id(), searcher,
|
QueryShardContext context = indexService.newQueryShardContext(canMatchRequest.shardId().id(), searcher,
|
||||||
request::nowInMillis, request.getClusterAlias());
|
canMatchRequest::nowInMillis, canMatchRequest.getClusterAlias());
|
||||||
Rewriteable.rewrite(request.getRewriteable(), context, true);
|
Rewriteable.rewrite(canMatchRequest.getRewriteable(), context, true);
|
||||||
} catch (Exception exc) {
|
} catch (Exception exc) {
|
||||||
listener.onFailure(exc);
|
listener.onFailure(exc);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (canRewriteToMatchNone(canMatchRequest.source())
|
if (canRewriteToMatchNone(canMatchRequest.source())
|
||||||
&& canMatchRequest.source().query() instanceof MatchNoneQueryBuilder) {
|
&& canMatchRequest.source().query() instanceof MatchNoneQueryBuilder) {
|
||||||
|
|
Loading…
Reference in New Issue