You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Luke Shannon <ls...@futurebrand.com> on 2005/04/19 22:29:14 UTC

Re: Best way to purposely corrupt an index?

The only time I have seen corrupted indexes is when the java process is
killed during the indexing process.

If you shutdown tomcat (or what ever you are running for java) during the
indexing process you will end up with a corrupted index.

----- Original Message ----- 
From: "Andy Roberts" <ma...@andy-roberts.net>
To: <ja...@lucene.apache.org>
Sent: Tuesday, April 19, 2005 5:22 PM
Subject: Best way to purposely corrupt an index?


> 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
>



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