Help

It's been quite some time since the latest release of Hibernate Search, but since the code base has been fairly stable and bug free, we have been holding it until now. But there are some interesting features that could not wait anymore:

  • transparent reindexing on all collection changes
  • support of Lucene 2.3 (performance improvements and stability)
  • query ResultTransformer making projections even more friendly

Transparent reindexing on collection change

Finally! This one has been annoying some of you for some time now. If you use Hibernate 3.2.6, Hibernate Search will reindex the entities on collection change. Be sure to add the appropriate additional event listeners

        <event type="post-collection-recreate"/>
            <listener class="org.hibernate.search.event.FullTextIndexCollectionEventListener"/>
        </event>
        <event type="post-collection-remove"/>
            <listener class="org.hibernate.search.event.FullTextIndexCollectionEventListener"/>
        </event>
        <event type="post-collection-update"/>
            <listener class="org.hibernate.search.event.FullTextIndexCollectionEventListener"/>
        </event>

This event listeners configuration will transparently be done when Hibernate Annotations 3.3.1 is out (the code is checked in already).

Lucene 2.3

Hibernate Search now runs Lucene 2.3. Hibernate Search is fully backward compatible with Lucene 2.2 but we highly recommend you to move to Lucene 2.3 (included in the latest Hibernate Search distribution) as some interesting performance improvements have been done by the Lucene team (I know, they did it again).

Query ResultTransformers

Projection query is a useful tool in some performance critical situations but the returned result is List<Object[]>: needless to say, not very developer friendly.

ResultTransformer, already available in regular Hibernate Core queries to post process the results, can now be used in Hibernate Search queries.

FullTextQuery query = s.createFullTextQuery( query, Employee.class );
query.setProjection("id", "lastname", "department");
query.setResultTransformer( new AliasToBeanResultTransformer(EmployeeView.class) );
List<EmployeeView> results = (List<EmployeeView>) query.list();

And a few other bug fixes

Some additional bug fixes and enhancements have been introduced, including @IndexedEmbedded used in multiple levels, Hibernate Search filter caching actually cache now with the standard Lucene CachingWrapperFilter and so on.

The release can be downloaded here, the complete changelog can be found at here.

Enjoy

6 comments:
 
20. Feb 2008, 22:16 CET | Link

Thank you very much, excellent work! Going to migrate now to new code, I will let you know about indexing performance.

ReplyQuote
 
23. Feb 2008, 16:30 CET | Link
Lee

I'm currently using Hibernate Search which comes with Seam 2.0.1. What is your recommendation, Can I just switch to this version?

 
24. Feb 2008, 01:31 CET | Link

Hi Lee, Absolutely, Hibernate Search 3.0.1 is fully backward compatible with 3.0.0. Go for it. The next Seam version will contain Hibernate Search 3.0.1.

 
26. Feb 2008, 18:23 CET | Link
Marc

It's not in the Jboss.org Maven repository yet.

 
01. Mar 2008, 18:00 CET | Link
Marc

It's now in JBoss but the required Hibernate 3.2.6 isn't. Is there a more reliable Maven repository for this?

 
15. Mar 2008, 05:02 CET | Link

Marc, I've added Hibernate in the jboss repository. Let me know how it goes.

Post Comment