Multiple select queries produced for fulltext result

Description

using (IFullTextSession s = ...
{
string q = "Code:ALPHA";
var result = s.CreateFullTextQuery<Customer>(q).List<Customer>();
}

250 Documents in Lucene are relevant for this query, for example.
Problem:
Expected 1 SQL query produced by NHibernate:
select a,b,c from Customer where Id in (IDs-returned-by-lucene)

But instead of this, NHibernate produces 250 SQL queries,
each with 'where id = x', namely for every Id returned from lucene it
produces query.

http://groups.google.com/group/nhusers/browse_thread/thread/794af54217bbdc7b

From what I've seen in code, problem is that List() method cals session.Load for each found result.
I think this is huge performance problem with NH.Search, that's why I mark this issue as Critical.

Thanks
Jozef

Environment

None

Activity

Show:
Jozef Sevcik
January 30, 2009, 6:49 AM

Attached patch.
I can get all tests pass, except that I don't pass even before applying patch - Concurrency.
I haven't really removed code I replaced - just commented it. If someone can confirm patch can be applied
I'll create final version where commented code will be removed.
Thanks

Jozef Sevcik
April 14, 2009, 11:32 AM

Anyone can apply that to trunk ? I really think this resolves huge performance problem with NH.Search trunk..
Thanks

Jozef Sevcik
July 25, 2009, 4:33 AM

From commit logs seems like this should be resolved in r844 ?

PaulP
July 25, 2009, 4:36 AM

Applied patch (r988) with the exception of the error handling change - not finding stuff in the database is an error not something to be treated as a debug only issue.

Fabio Maulo
January 28, 2011, 2:13 PM

Released 2.0.1

Assignee

PaulP

Reporter

Jozef Sevcik

Labels

None

Components

Fix versions

Affects versions

Priority

Critical
Configure