acquireSearcher should fail with state failure when not set/closed

also fixes #4232
This commit is contained in:
Shay Banon 2013-11-25 11:23:22 +01:00
parent efba3a50dd
commit 9648a53fd5
1 changed files with 3 additions and 0 deletions

View File

@ -684,6 +684,9 @@ public class RobinEngine extends AbstractIndexShardComponent implements Engine {
@Override
public final Searcher acquireSearcher(String source) throws EngineException {
SearcherManager manager = this.searcherManager;
if (manager == null) {
throw new EngineClosedException(shardId);
}
try {
IndexSearcher searcher = manager.acquire();
return newSearcher(source, searcher, manager);