lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: Deleting Problem
Date Thu, 01 Aug 2002 16:30:49 GMT
Terry Steichen wrote:
> fine now. (I thought I read someplace that you didn't have to optimize after
> a delete, but if I don't, it doesn't seem to work.)

You don't need to optimize after delete for search results to be 
correct.  However IndexReader.docFreq() may be incorrect until you've 
optimized.  So if your application requires that IndexReader.docFreq() 
is always correct, you'll need to optimize after deletes.

An alternative, if you sometimes need to know the actual current 
frequency, but don't want to optimize after deletes, is to make a single 
term query and use Hits.length().  This is slower than docFreq(), but 
does take account of deleted documents.


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

View raw message