lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Lamprecht <clampre...@gmail.com>
Subject Re: batch delete
Date Mon, 28 Mar 2005 08:13:48 GMT
Ben,

If you know the exact terms you want to delete, you can do it without querying:

IndexReader reader = IndexReader.open(indexDir);
Term deleteTerm = new Term("yyyymmdd", yyyymmdd);
reader.delete(deleteTerm);

If you are using a lucene date field, I think you'll have to enumerate
through all the dates that you want to delete.  You can use
reader.terms(Term) to get an enumeration of terms.

-chris

On Mon, 28 Mar 2005 17:58:44 +1000, Ben <newreaders@gmail.com> wrote:
> BTW is it possible to do what I am trying to achieve without querying
> the database or the index?
> 
> Thanks,
> Ben
> 
> On Mon, 28 Mar 2005 10:38:52 +1000, Ben <newreaders@gmail.com> wrote:
> > Hi
> >
> > I need to delete a number of documents that are older than a
> > particular time from a Lucene index. What is the best way to do this?
> >
> > Thanks,
> > Ben
> >
> 
> ---------------------------------------------------------------------
> 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