What is the idiomatic way to delete old documents from a Lucene Index?
I have a date field (YYYYMMddhhmmss) on all of the documents, and I’d like to remove anything more than a day old (for example).
Should I perform a filtered search or enumerate through the IndexReader’s documents?
I’m sure the question is the same regardless of which platform Lucene is running on.
Thanks!
Searching for YYYYMMdd* should work as currently dates are stored as text strings. Once you have the results, you could use IndexReader.delete to remove the docs you’re not interested in. That seems to me the best way to achieve this.