Use Ranking Policies

When a ranking policy is finalized, you must promote it to make it available to be assigned as a publishing channel default. If you want to assign the ranking policy as the global default, you must first publish the ranking policy. Setting a channel default ranking policy overrides the global default ranking policy.

Make a Ranking Policy the Global Default

The REST API for Content Delivery uses the global default policy to rank search results if there is no ranking policy assigned to the channel being searched or if there is no ranking policy specified via the rankBy parameter in the search query.

You must promote and publish the ranking policy before you can assign it as a the global default.

To assign a ranking policy as the global default:

  1. Sign in as a content administrator in your browser and click Content under Administration in the left navigation menu.
  2. Choose Ranking Policies from the drop-down list.
  3. Select the ranking policy you want to assign as the global default.
  4. Click Set as Global Default.

    The ranking policy displays a "Global Default" tag next to it.

You can change the global default by performing the steps above on a different custom ranking policy. You can also revert to the out-of-the-box ranking policy by selecting the custom ranking policy that is the current global default, then clicking Remove as Global Default.

You can also override the global default for a specific publishing channel by assigning a ranking policy as a channel default.

Assign a Ranking Policy as a Channel Default

The REST API for Content Delivery uses the channel default policy to rank search results if there is no ranking policy specified via the rankBy parameter in the search query.

You must promote the ranking policy before you can assign it as a channel default.

You can assign a default ranking policy for a publishing channel when you create the channel or you can edit the channel to assign the ranking policy.

To edit a publishing channel to assign a ranking policy as the channel default:

  1. Sign in as a content administrator in your browser and click Content under Administration in the left navigation menu.
  2. Choose Publishing Channels from the drop-down list.
  3. Open the publishing channel to which you want to assign the ranking policy.
  4. Under Search Results Ranking, choose the ranking policy you want to assign as the default and the asset types to which you want to apply the ranking policy.
    • If you set a ranking policy scope, the ranking policy will be applied to results that match the ranking policy rules, but only if the assets are of an asset type selected here.
    • If you don't set a ranking policy scope and a user limits their search to one or more asset types, the ranking policy will be applied to all results that match the ranking policy rules (both standard field rules and user-defined field rules).
    • If you don't set a ranking policy scope and a user doesn't limit their search to an asset type, only the standard field rules in the ranking policy will be used to apply the ranking policy.
  5. Click Save.

You can also assign a published ranking policy as the global default.

Use a Ranking Policy on a Search Request in REST API for Content Delivery

You can pass in a custom ranking policy as a URL parameter for a search query in the REST API for Content Delivery. Specify the ranking policy by name in the rankBy parameter of a search query to the Items endpoint. Using this method overrides the global ranking policy default and any channel default, controlling how matched items are sorted in that search request.

To submit a search query with the rankBy parameter in the REST API for Content Delivery, use the following syntax:

GET: https://instanceName-accountName.cec.ocp.oraclecloud.com/content/published/api/v1.1/items?q=(type eq "TypeName")&rankBy=RankingPolicyName

For example:

GET: http://instanceName-accountName.cec.ocp.oraclecloud.com/content/publsihed/api/v1.1/items?q=(type eq "Blog")&rankBy=BoostPolicy