Wednesday, August 10, 2022

Edit search configuration in Sitecore Content Hub

 How to restrict properties from Sitecore Content Hub API response?


We can add our own search configuration in the Sitecore Content Hub to limit the data in API response.

1. Go to Manage page > Settings > Search for Search keyword






2. Click on "+ Setting " and add your own setting

 For example: Test_SearchConfig


3. Sample code for search configuration


{

  "name": "Test_SearchConfig",

  "pageSize": 10,

  "filters": [

    {

      "definition": "M.Asset",

      "type": "definition"

    },

    {

      "definition": "M.Final.LifeCycle.Status",

      "type": "relation",

      "field": "FinalLifeCycleStatusToAsset",

      "operator": "Equals",

      "valueExpression": "String(\"StatusValue\") == \"Approved\""

    },

    {

      "definition": "M.Content.Repository",

      "type": "relation",

      "field": "ContentRepositoryToAsset",

      "operator": "Equals",

      "valueExpression": "String(\"ClassificationName\") == \"Standard\""

    }

  ],

  "propertiesToLoad": [

    "Filename",

    "Title"

  ],

  "renditionsToLoad": [

    "downloadOriginal"

  ]

}


No comments:

Post a Comment

How to Create a Public Link Using the Sitecore Content Hub REST API

Creating a public link using the Sitecore Content Hub REST API is a straightforward process that enables you to share content externally whi...