Re: Unable to add more than 1 document to Index

2008-04-24 Thread Hasan Diwan
The problem was that I was using the 3-parameter constructor for IndexWriter when I should have been using the 2-parameter one. It works fine now, many thanks for your kind assistance. -- Cheers, Hasan Diwan <[EMAIL PROTECTED]> -

Re: Unable to add more than 1 document to Index

2008-04-24 Thread Erick Erickson
Where are you getting your doc from? I see no Document doc = new Document() line in your code. So it's re-using an old one? Best Erick On Wed, Apr 23, 2008 at 10:43 PM, Hasan Diwan <[EMAIL PROTECTED]> wrote: >writer = new IndexWriter(indexLocation, new > StandardAnalyzer(), tru

Re: Unable to add more than 1 document to Index

2008-04-24 Thread Anshum
Hi Hasan, You had mentioned that you initialized the writer with 'true' as a parameter so I just thought you went wrong there. Is the problem resolved? Are you catching any exceptions during the process? -- Anshum On Thu, Apr 24, 2008 at 12:06 PM, Hasan Diwan <[EMAIL PROTECTED]> wrote: > Anshum

Re: Unable to add more than 1 document to Index

2008-04-23 Thread Hasan Diwan
Anshum: On 23/04/2008, Anshum <[EMAIL PROTECTED]> wrote: > The issue seems to be with the initialization of the index writer, try > initializing it with a the last parameter as false i.e. > *writer = new IndexWriter(indexLocation, new StandardAnalyzer(), false); writer = new IndexWriter(indexL

Re: Unable to add more than 1 document to Index

2008-04-23 Thread Anshum
Hi Hasan, The issue seems to be with the initialization of the index writer, try initializing it with a the last parameter as false i.e. *writer = new IndexWriter(indexLocation, new StandardAnalyzer(), false); *If you initialize it with the last argument as true, it creates a new index each time