I'm not sure what happens on Windows, but this should work just fine under UNIX. The files still really do exist on disk, I believe, they are just not visible after you delete them, and under UNIX the process will still have a references to deleted index files (inodes is the proper term in this context, I think) even after optimization, so IndexSearcher will work. This is easy to test.
Otis --- David Townsend <[EMAIL PROTECTED]> wrote: > 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 [mailto:[EMAIL PROTECTED] > 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 > segments. > 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. > > Otis > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
