There's a deleteAll() method on IndexWriter, which is very fast. After you commit(), all documents won't be visible to searchers anymore. When the last searcher will be closed, the documents will completely disappear from the index. All in all it's quite a good approach to take.
You can also consider creating a new index once a week, and after you finish adding documents, merging (perhaps even optimize() it), swap all your searchers to use the new directory and delete the old one. That is only relevant if you don't do deletes during the week (i.e., it's all or nothing). Shai On Wed, Oct 13, 2010 at 3:37 PM, Jeff Zhang <zjf...@gmail.com> wrote: > Hi all, > > I only want to index the latest one week's data, the previous data can > be deleted. So I'd like to know about lucene's delete performance and > whether it will has impact on the search performance when I do lots of > delete operation in the meantime. Thanks > > -- > Best Regards > > Jeff Zhang > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >