I read that in a lot of cases IndexWriter.optimize does not have to be called.

I then deleted it and my junit test case broke because results were coming back 
in the query that were not supposed to be coming back :(.  I think everything 
is single tested.  Maybe I should write a more raw junit test first? But I 
thought I would ask what exactly is optimize doing and is Lucene thread 
safe...I read that it was somewhere(but also read elsewhere it wasn't).

I kind of assumed my IndexWriters are not thread safe, but my IndexSearcher 
could be running while another thread is using the IndexWriter, right?

(Of course, while my unit test is single threaded and failed with just this one 
line change, our production system will be multithreaded which is why I ask).

Thanks,
Dean

This message and any attachments are intended only for the use of the addressee 
and
may contain information that is privileged and confidential. If the reader of 
the 
message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication in
error, please notify us immediately by e-mail and delete the message and any
attachments from your system.

Reply via email to