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 Karl Koch <Th...@gmx.net> on 2005/02/07 11:41:43 UTC

Retrieve all documents - possible?

Hi,

is it possible to retrieve ALL documents from a Lucene index? This should
then actually not be a search...

Karl

-- 
Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail

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


Re: Retrieve all documents - possible?

Posted by Andrzej Bialecki <ab...@getopt.org>.
Karl Koch wrote:
> Hi,
> 
> is it possible to retrieve ALL documents from a Lucene index? This should
> then actually not be a search...

You are right. Just use the IndexReader.document(int).


-- 
Best regards,
Andrzej Bialecki
  ___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com


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


Re: Retrieve all documents - possible?

Posted by Kelvin Tan <ke...@relevanz.com>.
Don't forget to test if a document is deleted with reader.isDeleted(i)

On Mon, 07 Feb 2005 12:09:35 +0100, Bernhard Messer wrote:
> you could use something like:
>
> int maxDoc = reader.maxDoc();
> for (int i = 0; i < maxDoc; i++) {
> Document doc = reader.document(i);
> }
>
> Bernhard
>
>> Hi,
>>
>> is it possible to retrieve ALL documents from a Lucene index?
>> This should then actually not be a search...
>>
>> Karl
>
>
> --------------------------------------------------------------------
> - 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


Re: Retrieve all documents - possible?

Posted by Bernhard Messer <be...@intrafind.de>.
you could use something like:

int maxDoc = reader.maxDoc();
for (int i = 0; i < maxDoc; i++) {
    Document doc = reader.document(i);
}

Bernhard

>Hi,
>
>is it possible to retrieve ALL documents from a Lucene index? This should
>then actually not be a search...
>
>Karl
>
>  
>


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