Forums de discussion

What is the search scoring logic used by Liferay DXP?

Vishnu S Kumar, modifié il y a 6 années.

What is the search scoring logic used by Liferay DXP?

Regular Member Publications: 131 Date d'inscription: 28/07/17 Publications récentes
I have a custom search portlet and need to do boosting for some fields and structures. I can do this using boost method in Query classes. Since my custom search portlet includes some OOB Liferay structures and custom structures I need to know whether Liferay has any scoring functionality over the elasticsearch scoring internally.
thumbnail
Jorge Díaz, modifié il y a 6 années.

RE: What is the search scoring logic used by Liferay DXP? (Réponse)

Liferay Master Publications: 753 Date d'inscription: 09/01/14 Publications récentes
Hi Vishnu,

You can add the boost configuration in a search calling com.liferay.portal.kernel.search.Query.setBoost(float) but you can also add a default boost in a entity for all queries creating a IndexerPostProcessor and set a boost on the required field.
More info see https://dev.liferay.com/develop/reference/-/knowledge_base/7-0/indexer-post-processor

About your question:
Vishnu S Kumar:
I have a custom search portlet and need to do boosting for some fields and structures. I can do this using boost method in Query classes. Since my custom search portlet includes some OOB Liferay structures and custom structures I need to know whether Liferay has any scoring functionality over the elasticsearch scoring internally.
The default boost for all fields is 1.
For certain fields (description, title, assetCategoryTitles etc.), Liferay sets the boost to 2 on Liferay side at some points when we create the query, see for example:

That query builders are used for example in following classes:
Vishnu S Kumar, modifié il y a 6 années.

RE: What is the search scoring logic used by Liferay DXP?

Regular Member Publications: 131 Date d'inscription: 28/07/17 Publications récentes
Thank You!