lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Miller" <>
Subject Re: Delete corrupted doc
Date Thu, 26 Jul 2007 12:49:46 GMT
This may not be very elegant, but if you are really in a jam, here is what I
would try:

Check out a copy of Lucene. Modify the isDeleted method on both MultiReader
and SegmentReader so that it returns true if the docid passed in is the id
in question (if it is not the id, then just have the method do what it
would). This will keep Lucene from looking in the deleted bitvector and
causing an arrayoutbounds exception...instead it will just return that the
bad id has been removed. Then run a full optimize. When the new segments are
created, your bad doc should be ignored and not make it into the new

Kind of a pain, but if you really cannot reindex...

- Mark

On 7/25/07, Rafael Rossini <> wrote:
> Hi guys,
>     Is there a way of deleting a document that, because of some
> corruption,
> got and docID larger than the maxDoc() ? I´m trying to do this but I get
> this Exception:
> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Array
> index out of range: 106577
>    at org.apache.lucene.util.BitVector.set(
>    at org.apache.lucene.index.SegmentReader.doDelete (
> :301)
>    at org.apache.lucene.index.IndexReader.deleteDocument(
> :674)
>    at org.apache.lucene.index.MultiReader.doDelete(
>    at org.apache.lucene.index.IndexReader.deleteDocument (
> :674)
>    at teste.DeleteError.main(
> Thanks

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message