Merge pull request #18094 from mikemccand/completion_stats_once
Don't try to compute completion stats on a reader after we already closed it Conflicts: core/src/main/java/org/elasticsearch/index/shard/IndexShard.java
This commit is contained in:
parent
15f33e61b7
commit
16c4c251f5
|
@ -680,9 +680,6 @@ public class IndexShard extends AbstractIndexShardComponent {
|
||||||
CompletionStats completionStats = new CompletionStats();
|
CompletionStats completionStats = new CompletionStats();
|
||||||
try (final Engine.Searcher currentSearcher = acquireSearcher("completion_stats")) {
|
try (final Engine.Searcher currentSearcher = acquireSearcher("completion_stats")) {
|
||||||
completionStats.add(CompletionFieldStats.completionStats(currentSearcher.reader(), fields));
|
completionStats.add(CompletionFieldStats.completionStats(currentSearcher.reader(), fields));
|
||||||
Completion090PostingsFormat postingsFormat = ((Completion090PostingsFormat)
|
|
||||||
PostingsFormat.forName(Completion090PostingsFormat.CODEC_NAME));
|
|
||||||
completionStats.add(postingsFormat.completionStats(currentSearcher.reader(), fields));
|
|
||||||
}
|
}
|
||||||
return completionStats;
|
return completionStats;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue