Hi, You could try opening the indexWriter with the 3rd arguement as false. The 3rd arg[] specifies whether a 'new' index has to be created or not. Something like
IndexWriter write = new IndexWriter(INDEX_FILE, new StandardAnalyser(), false); //Notice the 3rd arguement here I guess this should solve your problem (In case I did comprehend it correctly). -- Anshum ________________________________________ From: Nitasha Walia (niwalia) [EMAIL PROTECTED] Sent: Tuesday, April 08, 2008 4:07 AM To: [email protected] Subject: RE: Appending to index Hi, I am sorry, I don't quite understand what you meant by.. IndexWriter.updateDocument(...) HTH Let me re-phrase my question: I need to append to an existing index. Presently, the code is structured to check for the existing file, and exit if the file exists: if(INDEX_FILE.exists()) { System.out.println("Index File exists, remove existing index and retry"); System.exit(1); } IndexWriter write = new IndexWriter(INDEX_FILE, new StandardAnalyser(), true); indexDocs(writer, FILE_TO_BE_INDEXED); writer.optimize() writer.close(); What files do I need to modify ? And what functions? Can you please advise. Thanks, Nitasha -----Original Message----- From: Michael Wechner [mailto:[EMAIL PROTECTED] Sent: Monday, April 07, 2008 1:11 PM To: [email protected] Subject: Re: Appending to index Nitasha Walia (niwalia) wrote: >Hi, > >I am a new user of Java Lucene. The default index is such that a new >files is created every time, which requires me to delete the existing >index folder. > >I want to append to the existing index. Can someone please guide me on >how to do the same? > > IndexWriter.updateDocument(...) HTH Michael > >Thanks, >Nitasha Walia >Software Engineer, Cisco Systems > > > -- Michael Wechner Wyona - Open Source Content Management - Yanel, Yulup http://www.wyona.com [EMAIL PROTECTED], [EMAIL PROTECTED] +41 44 272 91 61 --------------------------------------------------------------------- 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]
