lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joseph Ottinger <j...@enigmastation.com>
Subject Re: IndexReader.delete(int) not working for me
Date Wed, 05 Mar 2003 18:11:15 GMT
Okay, I found the problem: it was a stupid coder. To wit, here's the
salient code:
Document d=indexReader.document(i);
if(d.getField("key").equals(node.getKey()) {
   ...
}

The error, of course, is that getField.equals() is comparing FIELDS and
not string values. When I changed this to pull the stringValue() out of
getField(), everything worked as expected. Turns out my logging actually
was spitting out the *wrong* message somewhere else, which deceived
me^Wthe stupid coder into thinking the removal was occurring when it was
not.

Now everything's working fine. Thank you for your time.

On Wed, 5 Mar 2003, Doug Cutting wrote:

> Joseph Ottinger wrote:
> > Then this means that my IndexReader.delete(i) isn't working properly. What
> > would be the common causes for this? My log shows the documents being
> > deleted, so something's going wrong at that point.
>
> Are you closing the IndexReader after doing the deletes?  This is
> required for the deletions to be saved.
>
> What makes you think that that delete is not working properly?
>
> Doug
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>

---------------------------------------------------------
Joseph B. Ottinger                 joeo@enigmastation.com
http://enigmastation.com                    IT Consultant


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


Mime
View raw message