-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Dynamic Boost alternative for Elasticsearch?
PostPosted: Fri Jun 16, 2017 12:21 am 
Newbie

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

Quote:
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?

edit:

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

Code:
qb.bool()
      .must( qb.keyword().onField("productName").matching(searchTerm).createQuery() )
      .should( qb.keyword().onField("featured").matching(true).createQuery() )
    .createQuery();


edit2:

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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 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.