Googlize your entities: NHibernate & Lucene.NET Integration
I need to do full text searches on my entities, across many different fields, and with many different parameters. A while ago I heard about Hibernate Search(TM), and became envious. It took me about two days*, but it is (almost) here. Here is how I search my blog's posts at the moment:
using (ISession session = sessionFactory.OpenSession())
using (IFullTextSession ftSession = Search.CreateFullTextSession(session))
{
IList<Post> posts = ftSession.CreateFullTextQuery<Post>("Text:NHibernate and Title:Performance")
.List<Post>();
Assert.AreNotEqual(0, posts.Count);
}
And yes, I probably do have seamless integration with updating the indexes, so I wouldn't have to worry about it except for the first time. I strongly suggest that you would read the documentation above, since it is almost identical to my implementation.
Unlike most of my stuff, I am not going to release it just yet, it still needs more testing and some beating before I will let it see the light of day.
* And just to point out, no sleep, for real. I am working on caffiene and sheer inertation at the moment.
Comments
I played with the same idea and figured you were doing something like it when I saw you extensible xsd-post. It's a good thing you are around, cause you save other developers major work and headaches ;)
Do you sleep or eat?? Awesome work!!
Do you still have a girlfriend :-) ?
I think your sheer energy and commitment to things will force me over to the NHibernate / ActiveRecord side.
Awesome, Oren!
Comment preview