lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben <newread...@gmail.com>
Subject Re: batch delete
Date Mon, 28 Mar 2005 08:19:46 GMT
OK, so I have to query for a list of old documents (from a given date)
and delete each document individually?

Can I use DateFilter.Before() with Term?

Thanks,
Ben

On Mon, 28 Mar 2005 02:13:48 -0600, Chris Lamprecht
<clamprecht@gmail.com> wrote:
> 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
> 
>

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