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 Enrique Lamas <en...@corp.ya.com> on 2006/10/30 11:39:39 UTC

How do I obtain the document id in order to delete from index?

Hi,
I've been reading Lucene documentation and I see there are two ways of deleting a document from an index: by id and by term.

Supose I have an index with three fields: field1, field2 and field3, and I want to delete all documents with field1=value1 and field2=value2.
I think I must use deletion by Id, but I don't know how to obtain the Id of the documents I want to delete.

Thanks

Re: How do I obtain the document id in order to delete from index?

Posted by Enrique Lamas <en...@corp.ya.com>.
I think I found it.

I must do a query an then loop through the hits to obtain the id with 
hit.id(int n).

If anyone knows any better way...

Thanks


----- Original Message ----- 
From: "Enrique Lamas" <en...@corp.ya.com>
To: <ja...@lucene.apache.org>
Sent: Monday, October 30, 2006 11:39 AM
Subject: How do I obtain the document id in order to delete from index?


Hi,
I've been reading Lucene documentation and I see there are two ways of 
deleting a document from an index: by id and by term.

Supose I have an index with three fields: field1, field2 and field3, and I 
want to delete all documents with field1=value1 and field2=value2.
I think I must use deletion by Id, but I don't know how to obtain the Id of 
the documents I want to delete.

Thanks 


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