开发者

Full Text Search in lambda expression

Greeting of the day

I am facing a problem in my application. I need to implement Full Text Search in Nhibernate.For that i am using Islike with Session.QueryOver. I have made my query in Nhibernate as follow:-

Session.Q开发者_开发知识库ueryOver<Product>().Where(p=>p.Description.IsLike(searchSting, MatchMode.Anywhere);

'searchSting' string over here is kind of statement like "Shirt men". Now i need to search with each words that is with shirt and men separately.

Any help will be appreciated, Thanks


You will need a full text search provider for this, either in your database if supported or using something like lucene.

If you don't mind putting attributes on your entities, NHibernate.Search works well (you just need to put your queries through a full text session instead of your normal session). This looks like as good a place as any to start: NHibernate 3 Search Tutorial. Documentation for NHibernate.Search is kind of sparse though, I typically end up finding answers here when I have a more specific question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜