You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Sheldon Shi <ss...@tightlink.com> on 2002/02/07 01:01:48 UTC

Problem when updating a document in an index

When I tried to update a single document in an index, I deleted 
it first and then added it to the index again. But when I do
search both the old version and the new version show up. When
I look at the index files, the deletable contains the files
that are supposedly to be deleted, but somehow I could still search
them. IndexReader is closed after the deletion, and a new
IndexWriter is opened for the addition. Optimize() is called
after adding the document. I tried to open a new IndexWriter
after deletion and call its optimize() (then close()) before 
opening another IndexWriter for addition. The problem did not go away.
I am using Lucene1.01.

Thanks for any help.

Sheldon


Re: Problem when updating a document in an index

Posted by Ian Lea <ia...@blackwell.co.uk>.
1.01?  The latest release is 1.2-rc3.  I suggest you try your
code with the latest release and if it still doesn't work
post to this list the shortest possible program that
demonstrates the problem.


--
Ian.
ian.lea@blackwell.co.uk

Sheldon Shi wrote:
> 
> When I tried to update a single document in an index, I deleted
> it first and then added it to the index again. But when I do
> search both the old version and the new version show up. When
> I look at the index files, the deletable contains the files
> that are supposedly to be deleted, but somehow I could still search
> them. IndexReader is closed after the deletion, and a new
> IndexWriter is opened for the addition. Optimize() is called
> after adding the document. I tried to open a new IndexWriter
> after deletion and call its optimize() (then close()) before
> opening another IndexWriter for addition. The problem did not go away.
> I am using Lucene1.01.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>