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 fernanvi <fe...@hotmail.com> on 2008/11/10 06:33:25 UTC

Get a Document by id

Hello.
I am trying to obtain a Document to work directly on it.
I have already the id number, but I do not know obtain like the object
Document from this number id.
...
			
while (td.next()) {
int docNum = td.doc();// document number
.....

I need get the docNum Document.

Thanks
-- 
View this message in context: http://www.nabble.com/Get-a-Document-by-id-tp20414568p20414568.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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


Re: Get a Document by id

Posted by prabin meitei <pr...@gmail.com>.
Hi,

if you have the document number then you can get the document by using
searcher = getSearcher();
document = searcher.doc(document number);

Prabin


On Mon, Nov 10, 2008 at 11:03 AM, fernanvi
<fe...@hotmail.com>wrote:

>
> Hello.
> I am trying to obtain a Document to work directly on it.
> I have already the id number, but I do not know obtain like the object
> Document from this number id.
> ...
>
> while (td.next()) {
> int docNum = td.doc();// document number
> .....
>
> I need get the docNum Document.
>
> Thanks
> --
> View this message in context:
> http://www.nabble.com/Get-a-Document-by-id-tp20414568p20414568.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>