lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dhruba Borthakur" <>
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.


>From: Morus Walter <>
>Reply-To: "Lucene Users List" <>
>To: "Lucene Users List" <>
>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 
> > with
> > deleting documents from the index. Browsing the mail archive, I found 
> > the
> > following email (June 2003) listed the exact problem that I am 
> >
> > In short: I am using Field.text("id", "value") to mark a document. Then 
> > use
> > reader.delete(new Term("id", "value")) to remove the document: this
> > call returns 0 and fails to delete the document. The attached sample 
> > 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 
>Using keyword fields instead of text fields for the id should help.
>To unsubscribe, e-mail:
>For additional commands, e-mail:

Find and compare great deals on Broadband access at the MSN High-Speed 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message