lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dhruba Borthakur" <dhruba_bortha...@hotmail.com>
Subject Re: Re:can't delete from an index using IndexReader.delete()
Date Wed, 25 Feb 2004 09:45:03 GMT
The solution you suggested works fine. Thanks a lot for your help.

dhruba


>From: Morus Walter <morus.walter@tanto.de>
>Reply-To: "Lucene Users List" <lucene-user@jakarta.apache.org>
>To: "Lucene Users List" <lucene-user@jakarta.apache.org>
>Subject: Re: Re:can't delete from an index using IndexReader.delete() Date: 
>Fri, 20 Feb 2004 10:33:08 +0100
>
>Dhruba Borthakur writes:
> > Hi folks,
> >
> > I am using the latest and greatest Lucene jar file and am facing a 
>problem
> > with
> > deleting documents from the index. Browsing the mail archive, I found 
>that
> > the
> > following email (June 2003) listed the exact problem that I am 
>encountering.
> >
> > In short: I am using Field.text("id", "value") to mark a document. Then 
>I
> > use
> > reader.delete(new Term("id", "value")) to remove the document: this
> > call returns 0 and fails to delete the document. The attached sample 
>program
> > shows this behaviour.
> >
>You don't tell us how your ids look like, but Field.text("id", value)
>tokenizes value, that is splits value into whatever the analyzer considers
>to be a token, and creates a term for each token.
>Whereas new Term("id", value) creates one term containing value.
>
>So I guess your ids are considered several token by the analyzer you use
>and therefore they won't be matched by the term you construct for the 
>delete.
>
>Using keyword fields instead of text fields for the id should help.
>
>Morus
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>

_________________________________________________________________
Find and compare great deals on Broadband access at the MSN High-Speed 
Marketplace. http://click.atdmt.com/AVE/go/onm00200360ave/direct/01/


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