lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: going from Document -> IndexReader's docid
Date Wed, 09 Nov 2005 18:03:11 GMT
The question is, how did you get that Document?   If you got it from  
Hits, you can get the document id from Hits.id(hit_num).

     Erik



On 9 Nov 2005, at 11:13, Yonik Seeley wrote:

> There really isn't a generic way... you have to search for the  
> document.
> If you have a unique id field in your document, you can find the
> document id quickly via IndexReader.termDocs(term)
>
> -Yonik
> Now hiring -- http://forms.cnet.com/slink?231706
>
> On 11/9/05, tlittell@igb.uiuc.edu <tlittell@igb.uiuc.edu> wrote:
>
>>
>> If I have a Document object (doc), and I also have an IndexReader  
>> open,
>> how can I find out IndexReader's docid corresponding to (doc)?
>>
>> IndexReader has a map from docid -> Document, but I don't see the  
>> reverse.
>>
>> thanks in advance,
>> Todd
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>


---------------------------------------------------------------------
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