Java, Lucene : Set lock timeout for IndexWriter in Java.
问题 I am working on integrating Lucene with our Spring-MVC based application. Currently we have it working, but rarely we get a cannot obtain lock error. After which I have to manually delete the lock file and then it works normally. How can I set a timeout for Locking the index in Java? I don't have any XML configuration for Lucene. I added the project library in maven via POM.xml and instantiated the required classes. Code : public void saveIndexes(String text, String tagFileName, String