lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mindaugas Žakšauskas" <min...@gmail.com>
Subject Optimization and commit
Date Fri, 02 Jan 2009 11:04:28 GMT
Hi,

I was reading the 2.4 javadoc as well as other sources but couldn't
find clear answer.
I need to know whether the sequence
   (1) open index writer -> (2) write something to index -> (3)
optimize index -> (4) commit
can corrupt the index / lose the data written at the point of (2)
after (4) is called.

LUCENE-1335 is quite close to what I was looking for, but it only
addresses the point of concurrency - e.g. what happens if one thread
is in the middle of commit() while another thread requests optimize(),
although it doesn't say what happens if optimize() is finished. The
concurrency here is also relevant, the most complex case being when
(2), (3) and (4) are executed multiple times from different threads.

By unable to find the requirement to commit() before optimize() I
assume the API guarantees the index consistency (but not the freshness
before commit()).
Some basic tests I've done showed my assumption is correct, however I
would like to get a confirmation.

I also think it would make sense to add this to the
IndexWriter#optimize() Javadoc, wouldn't it?

Regards,
Mindaugas

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


Mime
View raw message