From a06ecb8b7b5ef7b2f57f153939a25cc739c54255 Mon Sep 17 00:00:00 2001 From: David Leifker Date: Mon, 30 Sep 2024 17:53:37 -0500 Subject: [PATCH] docs(search): example of entity weighting --- docs/how/search.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/how/search.md b/docs/how/search.md index 5c1ba266ee2ae..4df5e7c1984d5 100644 --- a/docs/how/search.md +++ b/docs/how/search.md @@ -398,6 +398,32 @@ queryConfigurations: boost_mode: multiply ``` +##### Example 4: Entity Ranking + +Alter the ranking of entities. For example, chart vs dashboard, you may want the dashboard +to appear above charts. This can be done using the following function score and leverages a prefix match on the entity type +of the URN. Depending on the entity the weight may have to be adjusted based on your data and the entities +involved since often multiple field matches may shift weight towards one entity vs another. + +```yaml +queryConfigurations: + - queryRegex: .* + + simpleQuery: true + prefixMatchQuery: true + exactMatchQuery: true + + functionScore: + functions: + - filter: + prefix: + urn: + value: 'urn:li:dashboard:' + weight: 1.5 + score_mode: multiply + boost_mode: multiply +``` + ### Search Autocomplete Configuration Similar to the options provided in the previous section for search configuration, there are autocomplete specific options