lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <>
Subject Re: Removing old datas from index file
Date Thu, 20 May 2010 08:33:58 GMT
> I need to learn whether there is a way to remove some records on indexed
> files.

Of course.  See IndexReader and IndexWriter deleteXXX methods.

> And is it rapid for removing some indexed file records

Of course.

> (For example clean old records whose created date's are less than a definite day) .

If the created date is an indexed field you could do this with one of
the methods that takes a query - RangeQuery in your case from, say, 0
TO 20100101, dependent obviously on your data.  It the date field is
not indexed you could loop through all docs checking the date and
zapping the old ones by docNum


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

View raw message