lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Townsend" <>
Subject RE: Concurrency
Date Fri, 20 Feb 2004 16:37:57 GMT
Does this mean that if an IndexSearcher has hold of a segment file, then the index is optimised,
any subsequent search will use a list of files that probably don't exist anymore?

David Townsend

-----Original Message-----
From: Otis Gospodnetic []
Sent: 20 February 2004 13:26
To: Lucene Users List
Subject: Re: Concurrency

> Ive just got a couple of questions which i cant quite work
> out...wondered if 
> someone could help me with them:
> 1. What happens if i make a backup (copy) of an index while documents
> are 
> being added? Can it cause problems, and if so is there a way to
> safely do 
> this?

You should be okay.  When new documents are added, they are added to
new segments.  A 'table of contents' of all valid segments is in
'segments' file.  Even if you copy extra segments, your index will
still work, it's just that your searches may not search newly created
segments, whose existence was not registered in segments file, when you
copied the index.

> 2. When I create a new IndexSearcher, what method does Lucene use to
> take a 
> 'snapshot' of the index (because if i add documents after the search
> object 
> is created they dont appear in the search results)?

This is related to the answer under 1.  New documents are not seen with
an old IndexSearcher, because the old IndexSearcher is not aware of new
It would have to re-read the segments file and read any new segments
found, in order to become aware of new segments and documents in them.


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

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

View raw message