public void initialize(String directoryProviderName,
Properties properties,
SearchFactoryImplementor searchFactoryImplementor) {
// on "manual" indexing skip read-write check on index directory
boolean manual = searchFactoryImplementor.getIndexingStrategy().equals( "manual" );
File indexDir = DirectoryProviderHelper.getVerifiedIndexDir( directoryProviderName, properties, ! manual );
try {
indexName = indexDir.getCanonicalPath();
//this is cheap so it's not done in start()
directory = DirectoryProviderHelper.createFSIndex( indexDir );
}
catch (IOException e) {
throw new SearchException( "Unable to initialize index: " + directoryProviderName, e );
}
}
|