lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Engels" <reng...@ix.netcom.com>
Subject RE: refresh segments for deleted documents?
Date Mon, 01 May 2006 22:42:15 GMT
Thanks. I understand now. In my usage pattern deletions are never out of
sync - that is why it works.



-----Original Message-----
From: Doug Cutting [mailto:cutting@apache.org]
Sent: Monday, May 01, 2006 5:36 PM
To: java-dev@lucene.apache.org
Subject: Re: refresh segments for deleted documents?


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


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