Foren

What is the search scoring logic used by Liferay DXP?

Vishnu S Kumar, geändert vor 6 Jahren.

What is the search scoring logic used by Liferay DXP?

Regular Member Beiträge: 131 Beitrittsdatum: 28.07.17 Neueste Beiträge
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, geändert vor 6 Jahren.

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

Liferay Master Beiträge: 753 Beitrittsdatum: 09.01.14 Neueste Beiträge
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, geändert vor 6 Jahren.

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

Regular Member Beiträge: 131 Beitrittsdatum: 28.07.17 Neueste Beiträge
Thank You!