Oops, typo in my original message – the GetByCriteria query is “%Prince%”,
not “Prince%”.  

 

In another test, I pull out ~650 instances in both cases; the GetByCriteria
version currently takes about 45 seconds (I do need to review the mappings),
while the NHibernate.Search version takes over 9 minutes – which is just
silly. 

 

Can anyone offer any suggestions?

 

From: [email protected] [mailto:[email protected]] On Behalf
Of Rémi Després-Smyth
Sent: May 3, 2009 11:33 PM
To: [email protected]
Subject: [nhusers] Why is this query slower using NHibernate.Search?

 

I’ve been playing with NHibernate.Search, for Lucene.Net integration (using
NHib 1.2.1.4000).  Two test code snippets:

 

var parser = new QueryParser(field, new StandardAnalyzer());

Lucene.Net.Search.Query luceneQuery = parser.Parse("Prince*");

IFullTextSession fts = Search.CreateFullTextSession(session);

IQuery qry = fts.CreateFullTextQuery(luceneQuery, typeof(Customer));

var found = qry.List();

 

and this one (which is in my Customer DAO class):

 

var found = GetByCriteria(Expression.Like("City", "Prince%"));

 

There are about 4000 records in the table.  My Lucene.Net index was just
created before running these tests. 

 

Using Lucene.Net, this query takes about 35 seconds on my test machine.  The
second one, just using NHibernate, the query returns in under 5 seconds.
The bulk of the time spent in the Lucene.Net version is spent in the call to
qry.List() – it’s mostly time spent loading the instances.

 

I find this odd; shouldn’t the initializing/loading be based on the same
mapping file, thus loaded the same way (resulting in same load speed)?  I
would expect the Lucene.Net version to be quicker – or at least the same
speed, not this much slower.

 

Clearly, there is something going on here I don’t understand.  What am I
missing? Can anyone point me in the right direction?

 

Remi.



 


--~--~---------~--~----~------------~-------~--~----~
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