I have tried the following code:
 query.setRows(Integer.MAX_VALUE);
 query.setFields("id");

when it return 1000,000 records, it will take about 22s.
This is very slow. Is there any other way?


2009/7/23 Toby Cole <toby.c...@semantico.com>

> Have you tried limiting the fields that you're requesting to just the ID?
> Something along the line of:
>
> query.setRows(Integer.MAX_VALUE);
> query.setFields("id");
>
> Might speed the query up a little.
>
>
> On 23 Jul 2009, at 09:11, shb wrote:
>
>  Here id is indeed the uniqueKey of a document.
>> I want to get all the ids  for some other  useage.
>>
>>
>> 2009/7/23 Shalin Shekhar Mangar <shalinman...@gmail.com>
>>
>>  On Thu, Jul 23, 2009 at 1:09 PM, shb <suh...@gmail.com> wrote:
>>>
>>>  if I use query.setRows(Integer.MAX_VALUE);
>>>> the query will become very slow, because searcher will go
>>>> to fetch the filed value in the index for all the returned
>>>> document.
>>>>
>>>> So if I set query.setRows(10), is there any other ways to
>>>> get all the ids? thanks
>>>>
>>>>
>>> You should fetch as many rows as you need and not more. Why do you need
>>> all
>>> the ids? I'm assuming that by id you mean the uniqueKey of a document.
>>>
>>> --
>>> Regards,
>>> Shalin Shekhar Mangar.
>>>
>>>
> --
>
> Toby Cole
> Software Engineer, Semantico Limited
> <toby.c...@semantico.com> <tel:+44 1273 358 238>
> Registered in England and Wales no. 03841410, VAT no. GB-744614334.
> Registered office Lees House, 21-23 Dyke Road, Brighton BN1 3FE, UK.
>
> Check out all our latest news and thinking on the Discovery blog
> http://blogs.semantico.com/discovery-blog/
>
>

Reply via email to