Help

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.

17 comments:
 
07. Mar 2011, 20:20 CET | Link
magix

Sounds very nice. But where can I find the documentation for the new faceting API?

Matthias

 
08. Mar 2011, 14:27 CET | Link
Sounds very nice. But where can I find the documentation for the new faceting API?

The faceting API is really still in an Alpha stage. At the moment you can do discrete value faceting and range faceting on numbers. The configuration is atm via a QueryBuilder instance, but there will also be a annotation based configuration available similar to filter definitions. Via the DSL a simple facet search looks like this:

builder = fullTextSession.getSearchFactory().buildQueryBuilder().forEntity( Car.class ).get();
FacetRequest facet = builder.facet()
     .name( "myFacet" )
     .onField( "cubicCentimeters" )
     .createFacet();
Query luceneQuery = builder.keyword().onField( "make" ).matching( "Honda" ).createQuery();
FullTextQuery query = fullTextSession.createFullTextQuery( luceneQuery, Car.class );
query.enableFacet( facet );
Map<String, FacetResult> facetResults = query.getFacetResults();
//...
The design is still in progress so there will be more changes ahead. The public API classes are currently in org.hibernate.search.query.facet. Have a look at SimpleFacetingTest and RangeFacetingTest for more examples. Hope this helps for now. Better documentation will be included once the API has settled.

 
09. Mar 2011, 10:23 CET | Link
Sven

I am missing, how to set a facet value as a filter for the search in the above test cases. Normally after getting the facet values the user has the option the select one as a filter for the search. I cant see how it is done in the examples. Am I missing something or is there no information about this up to now?

in the moment I am using bobo-browse for faceted search. but I am looking forward to you implementation as it will -- hopefully -- much better integrate with the rest of hibernate search. thanks for your work!

 
10. Mar 2011, 14:14 CET | Link
I am missing, how to set a facet value as a filter for the search in the above test cases. Normally after getting the facet values the user has the option the select one as a filter for the search. I cant see how it is done in the examples. Am I missing something or is there no information about this up to now?

This will be part of the next release. Right now you would have to take the value from a Facet instance, create a TermQuery/RangeQuery from it and combine it with the existing query using a BooleanQuery. Obviously we want to make this easier for the developers. I see two alternatives. For exmaple, we could pass the original query into a Facet instance and get the new boolean query returned. In fact we probably need to pass in the original query, because we can take transparently care of this. Either way you would create a new fulltext query from the returned boolean query. The alternative would be to have an additional method on FullTextQuery, something like applyFacet(Facet facet). Not sure yet which way to go. Feel free to give some feedback.

 
15. Mar 2011, 12:33 CET | Link
Sven
Either way you would create a new fulltext query from the returned boolean query. The alternative would be to have an additional method on FullTextQuery, something like applyFacet(Facet facet). Not sure yet which way to go. Feel free to give some feedback.

If it is build as an own query, I would miss an important feature. This would mean -- as I understand it -- that for the applied filter only one facet would be valid, as the facets are build from the result. So if I have a filter with five values (1, 2, 3, 4, 5) and I select value 2, I would not get any facets for the other values, if I code this value directly into the query -- or am I wrong? But I would like to have the possibility to get the facet numbers for the other values, too. So that I can then also select e.g. value 3. So that I get all results that have either value 2 or value 3.

I hope, that I was able to make clear, what possibility I would like to have for drilling down the results.

15. Jun 2014, 14:54 CET | Link

This site is a leading resource for information about the Amanda Leto Fibroids Miracle PDF book that teaches you unique and rare tips on how to eliminate uterine fibroids and gain relief from fibroids symptoms in as little as 12 hours.https://rebelmouse.com/fibroidsmiracle/

15. Jun 2014, 17:33 CET | Link

The Fault in Our Stars like the stars themselves, permeating every character and every interaction. And yet in the midst of mortality we see at least a sliver of something alive. Even in pain, hope can be found, we’re told. Even in disappointment, meaning comes.watch christian movies online

15. Jun 2014, 19:32 CET | Link

Bloony Wheel, is a scientific cycle game with one wheel and balloon on other head. based on physics unicycle game. You target here is to control the game by balancing the balloon and the wheel. Play and enjoy Bloony wheel game.http://happywheelsusa.com/

16. Jun 2014, 08:03 CET | Link

Includes a collection of Igor Ledochowski Power Of Conversational Hypnosis reviews, PDF ebook download information, and hypnosis tips from around the web.www RebelMouse

16. Jun 2014, 19:07 CET | Link

This is important as this will greatly boost your conversion rates for the products and service you are providing as you will have the right kind of customer. Also the constant traffic we channel to your website will do a lot in lifting the ranking of your website giving it even more exposure in Google searches.Buy Targeted Traffic

17. Jun 2014, 13:45 CET | Link

I bought recently some original paintings from an art store ArtYou.com I am fascinated by the oil artworks with bright colors. It does look like many of the paintings have been done with palette knife. I particularly must say that they are quite unique and impressive. There are a plenty of young painters who are testing the bounds of art expression to generate unusual materials in the creation of their artworks. This originality has occurred as artists have searched for materials to fulfill a particular quality of color or texture that is outside the range of more usual materials. Their choice of media for their art reflects their awareness . They create an amazing diversity of surfaces by using oil and combinations. Depending on the degree of paint and the texture of the canvas the power of paint vary from a transparent wash to a full opaque impasto. The directness of the application when using different materials allows the painters to develop a composition rapidly in line and color and to focus on the primary task of creating a interesting design.

17. Jun 2014, 14:33 CET | Link

The great thing about BuildAModule is how well the videos are organized, by far the easiest to use and most approachable website among all of these resources. The only disadvantage when compared to Drupalize.me is that BuildAModule is a newer service that's not quite as established and credible, but the quality of the content is superb.Drupal Training

17. Jun 2014, 19:14 CET | Link

The various types of in ground pools differ in cost, often relying on where you reside, and each pool is available with its own advantages. The descriptions mentioned below will offer you a better introduction to your choices, but the in ground pool builder will know your locality well, and can counsel you on which option is the best.in ground pool ri

18. Jun 2014, 07:06 CET | Link

Includes a collection of Linda Allen Yeast Infection No More reviews, PDF ebook download information, and tips for treating a yeast infection from around the web.yeast infection no more book

18. Jun 2014, 09:41 CET | Link

Get Rid Of Herpes by Sarah Wilcox gives you instant, online access to a simple, step-by-step system in which Sarah teaches you her powerful secrets, techniques, and unique approach for getting rid of Herpes Simplex Virus Type 2 (Genital Herpes) quickly and naturally from the comfort of your own home.get rid of herpes

20. Jun 2014, 17:56 CET | Link

Includes a collection of Anna Wilson and Mirabelle Summers Conversation Chemistry reviews, PDF download information, and tips for flirting through words and body language from around the web.how can i carry on a conversation

22. Jun 2014, 08:33 CET | Link

Yeah, it's going to take some work on your part, but if you're tired of screwing things up, getting lost in the games and confusion, or always having to torment yourself over why she lost interest this time, then the Girlfriend Activation System is just what the doctor ordered. girlfriend activation system