IndexReader.delete(int) not working for me

2003-03-05 Thread Joseph Ottinger
I've got a versioning content system where I want to replace documents in a lucene repository. To do so, according to the FAQ and the mailing list archives, I need to open an IndexReader, look for the document in question, delete it via the IndexReader, and then add it. This shouldn't replace the

Re: IndexReader.delete(int) not working for me

2003-03-05 Thread Joseph Ottinger
Then this means that my IndexReader.delete(i) isn't working properly. What would be the common causes for this? My log shows the documents being deleted, so something's going wrong at that point. On Wed, 5 Mar 2003, Doug Cutting wrote: Joseph Ottinger wrote: This shouldn't replace the

Re: IndexReader.delete(int) not working for me

2003-03-05 Thread Doug Cutting
Joseph Ottinger wrote: Then this means that my IndexReader.delete(i) isn't working properly. What would be the common causes for this? My log shows the documents being deleted, so something's going wrong at that point. Are you closing the IndexReader after doing the deletes? This is required for

Re: IndexReader.delete(int) not working for me

2003-03-05 Thread Joseph Ottinger
Okay, I think I've done something stupid here: on closer examination, it looks like my comparison to find the specific documents to delete is failing. Let me look further at that. On Wed, 5 Mar 2003, Doug Cutting wrote: Joseph Ottinger wrote: Then this means that my IndexReader.delete(i) isn't

Re: IndexReader.delete(int) not working for me

2003-03-05 Thread Joseph Ottinger
Okay, I found the problem: it was a stupid coder. To wit, here's the salient code: Document d=indexReader.document(i); if(d.getField(key).equals(node.getKey()) { ... } The error, of course, is that getField.equals() is comparing FIELDS and not string values. When I changed this to pull the