lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vanlerberghe, Luc" <Luc.Vanlerber...@bvdep.com>
Subject RE: GData, updateable IndexSearcher
Date Fri, 28 Apr 2006 06:08:21 GMT
Here are some remarks from what I learned by inspecting the code (quite
a while ago now, but the principle shouldn't have changed)...

When an IndexReader opens the segments of an index it 
- grabs the commit lock, 
- reads the "segments" file for the list of segment names.
- opens the files for each segment (except the .del one), 
- *loads* the .del files associated with each segment (if present) and
then 
- releases the commit lock.

The segment files never change, and the .del files are loaded in memory
so an open IndexReader will always have the same view of its segments,
even if the .del files are changed by an other IndexReader.

So if you want to implement reopen() of a segment, you should be fine by
just reloading the .del file in memory for that segment (while holding
the commit lock of course).

Luc

-----Original Message-----
From: Yonik Seeley [mailto:yseeley@gmail.com] 
Sent: donderdag 27 april 2006 20:30
To: java-dev@lucene.apache.org; rengels@ix.netcom.com
Subject: Re: GData, updateable IndexSearcher

On 4/27/06, Robert Engels <rengels@ix.netcom.com> wrote:
> I thought each segment maintained its own list of deleted documents

Right.

> (since segments are WRITE ONCE

Yes, but deletions are the exception to that rule.  Once written,
segment files never change, except for the file that tracks deleted
documents for that segment.

Hence, if the segment name is the same, you should be able to count on
everything being unchanged *except* for which documents are deleted.

-Yonik
http://incubator.apache.org/solr Solr, the open-source Lucene search
server

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