_open.set(true);
if (!DirectoryReader.indexExists(directory)) {
LOG.info("Creating an empty index");
// if the directory is empty then create an empty index.
IndexWriterConfig conf = new IndexWriterConfig(LUCENE_VERSION, new KeywordAnalyzer());
conf.setWriteLockTimeout(TimeUnit.MINUTES.toMillis(5));
new BlurIndexWriter(directory, conf).close();
}
_indexReaderRef.set(DirectoryReader.open(directory));
_refresher.register(this);
}