Hi , The calls to the IndexWriter.addIndexes is synchronized. Your code should not have to do anything more than just calling it.
I believe roughly this will be the scenario that you are looking for: - while(there is more data) - spawn a thread to handle creating documents for this data - Thread creates documents and writes them to a RAMDirectory. - Write contents from the RAMDirectory to the File system dir. - end while You can pass an instance of your fileWriter to each of your threads so that they can write to it when they are done creating there individual RAMDirectories. -----Original Message----- From: Sodel Vazquez-Reyes [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 03, 2005 11:12 AM To: lucene-user@jakarta.apache.org Subject: Indexing in multi-threaded environment Hi, I am starting my application in multi-threaded environment, could somebody show me any examples with serialize calls to the IndexWriter.addDocument(Document)? because my idea is to use RAMDirectory based in parallel, one in each thread, and merges them into a single index on the disk using IndexWriter.addIndexes(Directory[]) method, It is working with a single process but I have problems with my threads implementation. Or any ideas about this. Best regards. Sodel. -- Sodel Vazquez-Reyes PhD Student --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ------------------------------------------------------------------------------------------ This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. Consult your physician prior to the use of any medical supplies or product. ------------------------------------------------------------------------------------------ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]