lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject RE: IllegalArgumentException: attempt to access a deleted document
Date Fri, 07 Oct 2005 00:35:53 GMT
Maybe somebody will suggest some workarounds, but I'll only suggest you
don't optimize your index after each deletion - see
http://www.lucenebook.com/search?query=when+to+optimize - the
suggestions are in the snippet of the 1st hit.

Otis


--- Peter Kim <pkim@cymfony.com> wrote:

> I think my best option will just be to optimize the index after each
> deletion. I guess this will be good for me anyways... For the cases
> where optimizing is not a luxury one can afford, it would be nice if
> there was another way around this.
> 
> Peter 
> 
> > -----Original Message-----
> > From: Peter Kim [mailto:pkim@cymfony.com] 
> > Sent: Thursday, October 06, 2005 7:08 PM
> > To: java-user@lucene.apache.org
> > Subject: IllegalArgumentException: attempt to access a 
> > deleted document
> > 
> > Hi,
> > 
> > I'm getting this error from trying to access a document in my 
> > custom hit
> > collector:
> > 
> > java.lang.IllegalArgumentException: attempt to access a 
> > deleted document
> >         at
> >
> org.apache.lucene.index.SegmentReader.document(SegmentReader.java:235
> > )
> >         at
> > org.apache.lucene.index.MultiReader.document(MultiReader.java:108)
> >         at
> > org.apache.lucene.search.IndexSearcher.doc(IndexSearcher.java:74)
> >         at
> > org.apache.lucene.search.MultiSearcher.doc(MultiSearcher.java:66)
> > 
> > 
> > Does anyone know why I'm getting this error? Shouldn't the 
> > ids passed to
> > 
> > HitCollector.collect(int id, float score) all be valid? Or 
> > are deleted ids not ignored?
> > 
> > I noticed one way to get around this is to use 
> > IndexReader.isDeleted() to check if it's deleted or not. The 
> > problem with that is I only have access to a MultiSearcher in 
> > my HitCollector which doesn't give me access to the 
> > underlying IndexReader. I don't want to have to open an 
> > IndexReader in my custom hit collector to use its isDeleted()
> method.
> > 
> > Anyone know any workarounds?
> > 
> > Thanks!
> > peter
> > 
> >
> ---------------------------------------------------------------------
> > 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
> 
> 


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