lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giulio Cesare Solaroli <giulio.ces...@gmail.com>
Subject Re: Deleting a document with an IndexWriter open
Date Fri, 16 Jul 2004 10:15:19 GMT
On Fri, 16 Jul 2004 10:00:08 +0200, Christiaan Fluit
<christiaan.fluit@aduna.biz> wrote:
> [snip]
> 
> That's exactly what we do. It's not optimal but it works.
> 
> My guess would be that the chosen architecture makes it possible to
> query the index while it is simultaneously being updated. I believe
> (correct me if I'm wrong) that you can add documents to an index and
> query it at the same time.

I can confirm this. That is what we were doing to find out if a
document ready to be indexed was already present on the index.

> Only the IndexReader won't see the new
> documents that have been added after it has been created.

That is also correct; we have already found a way around this problem
as we refresh the main IndexReader every few minutes to keep it
aligned with the content of the index.

> I can imagine
> that this is much harder to realize when IndexWriter can not only add
> documents but also delete them.

As far as I understand this, the indexReader blocks a copy of the
whole index as it is opened, in order to keep a consistent environment
while it is running. This should isolate it from update to the index,
both new documents and deleted documents.

But I don't know Lucene internals enough to bet a single cent on my
previous statement. :-]

> Can any of the Lucene designers tell me why you chose to create an
> IndexWriter and an IndexReader class instead of a single Index class
> that handles all these aspects for you? It seems to me that this way you
> could have solved a lot of these issues internally in Lucene, instead of
> leaving it up to the integrator.


Giulio Cesare Solaroli

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


Mime
View raw message