java.lang.IllegalStateException: same segment _0 has invalid changes; likely you are re-opening a reader after illegally removing index files yourself and building a new index in their place. Use IndexWriter.deleteAll or OpenMode.CREATE instead
at org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:194)
at org.apache.lucene.index.StandardDirectoryReader.doOpenIfChanged(StandardDirectoryReader.java:326)
跟write.lock无关
上面的意思是不能remove index and build a new index in their place.
应该使用 IndexWriter.deleteAll 来替代remove index.
http://www.cnblogs.com/likehua/archive/2012/02/16/2354532.html
http://www.blogjava.net/guming123416/archive/2011/02/28/269036.html