logger.error(MessageFormat.format("Lucene indexing failure for {0}", name), t);\r
}\r
}\r
+ \r
+ /**\r
+ * Close the writer/searcher objects for a repository.\r
+ * \r
+ * @param repositoryName\r
+ */\r
+ public void close(String repositoryName) {\r
+ try {\r
+ IndexWriter writer = writers.remove(repositoryName);\r
+ if (writer != null) {\r
+ writer.close();\r
+ }\r
+ } catch (Exception e) {\r
+ logger.error("Failed to close index writer for " + repositoryName, e);\r
+ }\r
+\r
+ try {\r
+ IndexSearcher searcher = searchers.remove(repositoryName);\r
+ if (searcher != null) {\r
+ searcher.close();\r
+ }\r
+ } catch (Exception e) {\r
+ logger.error("Failed to close index searcher for " + repositoryName, e);\r
+ }\r
+ }\r
\r
/**\r
* Close all Lucene indexers.\r