We did a big refactoring of the query engine, hence the alpha tag. If you could focus your tests in this area and see if there are any issues, we would be forever grateful.
This release comes with the usual mix of bug fixes, optimizations and new features.
Query engine refactoring
This was a biggie and the objective is that it does not affect you :) We have a medium term goal to make Hibernate Search not depend on Hibernate Core. Extracting the query engine core into well defined SPIs (Service Provider Interfaces) is a milestone for this. The first beneficiary is the Infinispan query module which will become much more resilient to Hibernate Search version changes.
As said earlier, test your applications queries. They should still run without any API change. Let us know otherwise.
Update index only when an indexed property changes
With previous version, when an @Indexed entity changes in Hibernate Core, it is reindexed by Hibernate Search even if none of the indexed properties have effectively changed (after all not all properties are indexed). Hibernate Search 3.4 is smarter in this area and tries not to reindex entities whose indexed properties are unchanged. In some situations like dynamic boosting or class-level bridges, Hibernate Search cannot be certain and always reindex to be safer.
This optimization should speed things up quite significantly for some applications. Check the documentation for more information.
Look for entities in the second level cache
In some environments, most if not all of the searched entities are in the second level cache. This is especially true when you use a distributed second level cache like Infinispan. You can ask Hibernate Search to look in the second level cache before trying to fetch data from the database.
FullTextQuery query = session.createFullTextQuery(luceneQuery, User.class); query.initializeObjectWith( ObjectLookupMethod.SECOND_LEVEL_CACHE, DatabaseRetrievalMethod.QUERY ); List results = query.getResultList();
Of course your entities must be cacheable :) If your entities are most likely in the persistence context (the Hibernate session), you can use ObjectLookupMethod.PERSISTENCE_CONTEXT instead.
MassIndexer improvements
The mass indexer module has had a few improvementse:
- multithreading of the text analysis phase
- improve monitoring the mass indexer state and progress by letting you plug a custom implementation (see MassIndexerProgressMonitor)
Faceting
Very requested and useful feature, you can now play with the first alpha preview of the new Faceting engine API.
Field Caching
It's now possible to use Lucene's FieldCache to provide an extra boost to query performance: see the reference documentation.
Other performance improvements
We have found a couple of tricks to improve overall performances. We more aggressively cache some metadata to lower the reflection overhead and we push some additional buttons in Lucene for you to reduce query time.
Give us feedback
Please give us feedback, we have an aggressive release schedule ahead as we are planning the GA version for end of this month.
Check out the new release on JBoss.org's Maven repository or download the distribution. You can also read the documentation.
If you find an issue, shoot.