{
Method method = Class.forName(IndexingConstants.LUCENE_INDEXER).getDeclaredMethod("getInstance",
String.class);
Indexer indexer = (Indexer) method.invoke(null, luceneDirectoryPath);
indexManager = new IndexManager(indexer, kunderaMetadata);
}
catch (Exception e)
{
logger.error(
"Missing lucene from classpath. Please make sure those are available to load lucene directory {}!",
luceneDirectoryPath);
throw new InvalidConfigurationException(e);
}
// indexManager = new IndexManager(LuceneIndexer.getInstance(new
// StandardAnalyzer(Version.LUCENE_CURRENT),
// luceneDirectoryPath));
}
else if (indexerClass != null)
{
try
{
Class<?> indexerClazz = Class.forName(indexerClass);
Indexer indexer = (Indexer) indexerClazz.newInstance();
indexManager = new IndexManager(indexer, kunderaMetadata);
clientMetadata.setIndexImplementor(indexerClass);
}
catch (Exception cnfex)
{
logger.error("Error while initialzing indexer:" + indexerClass, cnfex);
throw new KunderaException(cnfex);
}
}
else
{
indexManager = new IndexManager(null, kunderaMetadata);
}
// if
// (kunderaMetadata.getClientMetadata(persistenceUnit)
// ==
// null)