Hi,

Thanks for the reply. Are you saying that this (please correct if
inefficient):

List<Bla> return_list = new List<Bla>();

total = fullTextQuery.ResultSize;
int pagesize = 1500;
int pages = (int)Math.Ceiling((double)total / (double)pagesize);

for (int p = 1; p <= pages; p++)
{
    List<Bla> l = fullTextQuery.SetFirstResult((p - 1) *
pagesize).SetMaxResults(pagesize).List<Bla>().ToList<Bla>();

    foreach (Bla ms in l)
    {
        return_list.Add(ms);
    }
}

return return_list;

Is as efficient as this:

fullTextQuery.ToList<Bla>();

Thanks!

As I said I have to page over things as, if the pagesize is too large,
the generated SQL will be too long and the underlying RDBMS throws an
exception.

Christian

On Mar 17, 6:57 pm, Fabio Maulo <[email protected]> wrote:
> because Lucene work with Documents and NH work with your domain-entities.
> NH-Search is the bridge: it save Documents to make Lucene happy and give you
> entities to make you happy.
> btw you can page results in the same pace you are executing the query
>
>
>
> On Thu, Mar 17, 2011 at 2:23 PM, csetzkorn <[email protected]> wrote:
> > I cannot run the query without paging in the first place. so i take
> > the data in chunks using paging. this takes a bit of time though. I am
> > just curious why i cannot obtain all objects in one go? I know why,
> > looking at the sql though ... as the generated sql is too long. maybe
> > there is no other way as the query used ... where id in (long list of
> > ids).
>
> > On Mar 17, 4:09 pm, Fabio Maulo <[email protected]> wrote:
> > > Do you mean that a CreateFullTextQuery with pagination
> > > (SetMaxResults,SetFirstResult) is slower than the same query without
> > > pagination ?
> > > Please attach a test proving it.
> > > Thanks.
>
> > > On Thu, Mar 17, 2011 at 11:07 AM, Christian Setzkorn <
> > [email protected]>wrote:
>
> > > > Hi,
>
> > > > This code works fine:
>
> > > > Query query = parser.Parse(expression);
>
> > > > IFullTextSession session = Search.CreateFullTextSession(this.Session);
>
> > > > IFullTextQuery fullTextQuery = session.CreateFullTextQuery(query, new[]
> > {
> > > > typeof(MappedSequence) });
>
> > > > var l1 = fullTextQuery.List();
>
> > > > as long as the query does not return too many objects. If the query
> > > > contains too many objects the generated sql code is too long and sql
> > server
> > > > throws an exception:
>
> > > > "The incoming tabular data stream (TDS) remote procedure call (RPC)
> > > > protocol stream is incorrect. Too many parameters were provided in this
> > RPC
> > > > request. The maximum is 2100."
>
> > > > One working solution is to obtain all objects using paging which is
> > fairly
> > > > slow. Is there a better solution?
>
> > > > Thanks.
>
> > > > C
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "nhusers" group.
> > > > To post to this group, send email to [email protected].
> > > > To unsubscribe from this group, send email to
> > > > [email protected].
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/nhusers?hl=en.
>
> > > --
> > > Fabio Maulo
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "nhusers" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> >http://groups.google.com/group/nhusers?hl=en.
>
> --
> Fabio Maulo

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to