NHibernate and SQL Server full-text indexing

421 views
Skip to first unread message

John Rayner

unread,
May 27, 2008, 8:24:07 AM5/27/08
to nhusers
Hi there,

I've seen quite a few blog posts about using NHibernate with
Lucene.NET, but has anyone tried getting it to work with SQL Server
full-text indexing?

Cheers,
John

Ayende Rahien

unread,
May 27, 2008, 10:13:20 AM5/27/08
to nhu...@googlegroups.com
You need to create an derived dialect and register the contains function, if you want to use HQL.
Or, you can create an ICritertion implementation that will deal with this.

Ryan Rinaldi

unread,
May 28, 2008, 3:02:45 PM5/28/08
to nhu...@googlegroups.com

I've had good luck using the Expression.Sql() statement and using the sql "Contains" function:
 
Expression.Sql("Contains({alias}.PropertyName, ?", value, NHibernateUtil.String);




--
Ryan Rinaldi
msn: em...@ryanrinaldi.com
blog: http://blogs.geekdojo.net/ryan

DannyT

unread,
Jun 16, 2008, 1:37:57 PM6/16/08
to nhu...@googlegroups.com
Sorry to hijack but i'd be interested in people's opinions on Lucene.net, is it worthwhile, does the learning time and benefits outweigh using sql server (or other db) full indexed searches?

What would most do when faced with a search requirement that goes beyond simple criteria queries? What point would you suggest a criteria query doesn't cut it?

I'm currently working on an Intranet built on NH and for now we've just implemented criteria queries for the search but that's just for demonstration purposes and I can't imagine will cut it for long so any thoughts would be much appreciated.

Dan




2008/5/28 Ryan Rinaldi <ryan.r...@gmail.com>:



--
http://danny-t.co.uk

Ayende Rahien

unread,
Jun 16, 2008, 1:47:53 PM6/16/08
to nhu...@googlegroups.com
I like lucene. A lot.
It is useful because it is externalizing the search, reducing the DB work to a simple query by PK, the fastest you could get.
It also allows you to give the user a "command line" into the application. I used it at one place to allow users to search on very complex model.
The UI was a textbox and a button.
I sold it to the client as a Google for your DB
Reply all
Reply to author
Forward
0 new messages