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.
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
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.
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.
Anyone can apply that to trunk ? I really think this resolves huge performance problem with NH.Search trunk..
From commit logs seems like this should be resolved in r844 ?
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.