add new documents to clucene

302 views Asked by At

I am trying to add a new document to an existing clucene index. My IndexWriter looks like this:

index_writer = _CLNEW IndexWriter( path_to_index, &analyzer, false);

The third parameter is 'false' because I do not want to recreate the index. Unfortunately, the new document is NOT getting added. If I change it to 'true', naturally, the index gets overwritten.

Any ideas? Thanks in advance.

1

There are 1 answers

0
bvanklinken On

Can you show us the rest of your code?

Best guess is are you flushing the index after writing to it?

Perhaps have a look at the demo code which shows you how to index a basic document.