lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger Keays <roger.ke...@ninthavenue.com.au>
Subject Re: IndexWriter.deleteDocuments(term) deletes everything
Date Wed, 28 Mar 2007 03:32:39 GMT
Roger Keays wrote:
> Hi there,
> 
> I'm trying to delete a single document by using its uuid field:
> 
>     uuid = new Term("uuid", item.getUuid().toString());
>     writer.deleteDocuments(uuid);
>     writer.close();
> 
> However, it appears that this operation is deleting *every* document, 
> whether the uuid matches or not. The uuid field is created with
> 
>     doc.add(new Field("uuid", item.getUuid().toString(),
>             Field.Store.YES, Field.Index.UN_TOKENIZED));
> 
> and I can make queries like uuid:76 which return the correct document. 
> Is there something wrong with the way I am using deleteDocuments()? I'm 
> using lucene-2.1.0.

never mind... I had create=true on my IndexWriter, misunderstanding that 
that meant 'always recreate the index'.

> 
> Thanks in advance,
> 
> Roger
> 


-- 
----------------------------------------
Ninth Avenue Software
p: +61 7 3137 1351 (UTC +10)
f: +61 7 3102 9141
w: http://www.ninthavenue.com.au
e: info@ninthavenue.com.au
----------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message