lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <ian....@gmail.com>
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



--
Ian.

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