Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Is the IndexWriter class, and especially the method addIndexes(Directory[]) thread safe?

0
Posted

Is the IndexWriter class, and especially the method addIndexes(Directory[]) thread safe?

0

Yes, IndexWriter.addIndexes(Directory[]) method is thread safe (it is a synchronized method). IndexWriter in general is thread safe, i.e. you should use the same IndexWriter object from all of your threads. Actually it’s impossible to use more than one IndexWriter for the same index directory, as this will lead to an exception trying to create the lock file.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123