Ayende @ Rahien

Unnatural acts on source code

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

Grimace of Despair
03/18/2007 03:38 PM by
Grimace of Despair

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 ;)

agilejoe
03/18/2007 03:58 PM by
agilejoe

Do you sleep or eat?? Awesome work!!

Richard LOPES
03/18/2007 09:19 PM by
Richard LOPES

Do you still have a girlfriend :-) ?

Brian
03/19/2007 02:20 AM by
Brian

I think your sheer energy and commitment to things will force me over to the NHibernate / ActiveRecord side.

Comments have been closed on this topic.