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 Bill Tschumy <bi...@otherwise.com> on 2004/07/08 03:46:44 UTC

Deleting a Doc found via a Query

I must be missing something here, but I can't see an easy way to delete 
a Document that has been found via searching.  The delete() method of 
IndexReader takes a docNum.  How do I get the docNum corresponding to 
the Document in the Hits?

I tried scanning through all the Documents using IndexReader's 
document(i) method, testing for equality (==) with my queried Document, 
but it wasn't found.  I assume this is because the Documents returned 
in Hits are copies of the Documents the document() method returns.
-- 
Bill Tschumy
Otherwise -- Austin, TX
http://www.otherwise.com


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


Re: Deleting a Doc found via a Query

Posted by Bill Tschumy <bi...@otherwise.com>.
Thanks.  This works fine.  I guess I was missing something <g>.  I  
would have expected this to be a property of Document.


On Jul 7, 2004, at 8:49 PM, Peter M Cipollone wrote:

> Bill,
>
> Check
> http://jakarta.apache.org/lucene/docs/api/org/apache/lucene/search/ 
> Hits.html#id(int)
>
> Pete
>
> ----- Original Message -----
> From: "Bill Tschumy" <bi...@otherwise.com>
> To: "Lucene Users List" <lu...@jakarta.apache.org>
> Sent: Wednesday, July 07, 2004 9:46 PM
> Subject: Deleting a Doc found via a Query
>
>
>> I must be missing something here, but I can't see an easy way to  
>> delete
>> a Document that has been found via searching.  The delete() method of
>> IndexReader takes a docNum.  How do I get the docNum corresponding to
>> the Document in the Hits?
>>
>> I tried scanning through all the Documents using IndexReader's
>> document(i) method, testing for equality (==) with my queried  
>> Document,
>> but it wasn't found.  I assume this is because the Documents returned
>> in Hits are copies of the Documents the document() method returns.
>> -- 
>> Bill Tschumy
>> Otherwise -- Austin, TX
>> http://www.otherwise.com
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>
-- 
Bill Tschumy
Otherwise -- Austin, TX
http://www.otherwise.com


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


Re: Deleting a Doc found via a Query

Posted by Peter M Cipollone <lu...@bihvhar.com>.
Bill,

Check
http://jakarta.apache.org/lucene/docs/api/org/apache/lucene/search/Hits.html#id(int)

Pete

----- Original Message ----- 
From: "Bill Tschumy" <bi...@otherwise.com>
To: "Lucene Users List" <lu...@jakarta.apache.org>
Sent: Wednesday, July 07, 2004 9:46 PM
Subject: Deleting a Doc found via a Query


> I must be missing something here, but I can't see an easy way to delete
> a Document that has been found via searching.  The delete() method of
> IndexReader takes a docNum.  How do I get the docNum corresponding to
> the Document in the Hits?
>
> I tried scanning through all the Documents using IndexReader's
> document(i) method, testing for equality (==) with my queried Document,
> but it wasn't found.  I assume this is because the Documents returned
> in Hits are copies of the Documents the document() method returns.
> -- 
> Bill Tschumy
> Otherwise -- Austin, TX
> http://www.otherwise.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>
>


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