Hibernate Books

All times are UTC - 5 hours [ DST ]

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Dynamic Boost alternative for Elasticsearch?
PostPosted: Fri Jun 16, 2017 12:21 am 

Joined: Sat Feb 27, 2016 1:47 am
Posts: 14
As per the docs, it's seems dynamic boosting is not supported with the elasticsearch implementation:

The org.hibernate.search.annotations.DynamicBoost annotation is not (and cannot be) supported with Elasticsearch, because the platform lacks per-document, index-time boosting capabilities. Static boosts (@Boost) are, however, supported.

I'm not currently using elasticsearch, however I am planning to migrate to it shortly. However, without any alternative solution to dynamic boosting, this might be difficult. My scenario is that I have a boolean variable, that when true should provide a boost to the entity. Specifically, the boolean variable represents whether a product is featured or not, and featured products should place higher in search results.

Is there a way to achieve this without using a Dynamic Boost? Maybe at search time?


If I used a should query, will that have the same effect? eg

      .must( qb.keyword().onField("productName").matching(searchTerm).createQuery() )
      .should( qb.keyword().onField("featured").matching(true).createQuery() )


similarly, I have a dynamic boost based on the popularity of a product, eg the more views, likes, reviews etc a product has, the higher it should rank. How would I achieve this at query time? Is there any way to apply a boost based on the value of a field?

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours [ DST ]

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.