Weir, Michael wrote:
I assume that it is possible to corrupt an index by crashing at just the right
time.

It should not be possible to corrupt an index this way.


I notice that there's a method IndexReader.unlock().  Does this method
ensure that the index has not been corrupted?

If you use this method, it is possible to corrupt things. In particular, if you unlock an index that another process is modifying, then modify it, then these two processes might step on one another. So this method should only be called when you are certain that no one else is modifying the index.


There is no index integrity checker. I suppose one could implement one by implementing a NullDirectory that ignores all reads and writes, then use IndexWriter.addIndexes() to add the index to be checked to a NullDirectory. That would parse all of the files in the index.

Doug

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to