lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: refresh segments for deleted documents?
Date Mon, 01 May 2006 22:36:04 GMT
Robert Engels wrote:
> Doug, can you comment on exactly why the 'deletions' need to be re-read?
> Doesn't seem necessary to me.

A common idiom is to use one IndexReader for searches, and a separate 
for deletions.  For example, one might do something like:

1. Open IndexReader A.
2. Start serving queries against A.
3. Open IndexReader B.
4. Process queued deletions/updates against B.
5. Close B.
6. Open IndexWriter C.
7. Process queued additions/updates against C.
8. Close C.
9. Sleep until 1 minute has elapsed.
10. Go to step 1.

This would publish a new version of the index every minute, attempting 
to batch insertions, updates and deletes, as is optimal.  In this case, 
if you re-open A, its deletions could be out-of sync, but if you re-open 
B its deletions would not be out of sync.

So perhaps in your usage pattern deletions are never out of sync at 
re-open, but there are also reasonable usage patterns where deletions 
can become out of sync on re-open.

Doug

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message