lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Roberts <m...@andy-roberts.net>
Subject Best way to purposely corrupt an index?
Date Tue, 19 Apr 2005 21:22:08 GMT
Hi,

Seems like an odd request I'm sure. However, my application relies an index, 
and should the index become unusable for some unfortunate reason, I'd like my 
app to gracefully cope with this situation.

Firstly, I need to know how to detect a broken index. Opening an IndexReader 
can potentially throw an IOException if a problem occurs, but presumably this 
will be thrown for other reasons, not just an unreadable index. Would the 
IndexReader.indexExists() be better?

Secondly, to test how my code responds to broken indexes, I'd like to 
purposely break an index. Any suggestions, or will removing any file from the 
directory be sufficient?

Many thanks,
Andy

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message