Search Managed Content

AVAILABLE API VERSION
API v67.0 and later

The searchContentInChannels operation searches for published content across one or more CMS channels. Each piece of content appears only once in the results, even if it’s published to multiple channels. Results are ordered by relevance, with the best matches appearing first.

Simple Search Query 

Here’s a basic example of a keyword search for content across two CMS channels. The results include the content ID, title, and content type.

Search content with keyword
1query searchContent {
2  managed_content {
3    search {
4      searchContentInChannels(
5        searchIdentifiers:{
6          channelIds: ["0apxx0000000002AAA","0apxx0000000001AAA"]
7        }
8        keyword: "product announcement"
9      ) {
10        total
11        offset
12        pageSize
13        items {
14          managedContentId
15          title
16          contentType
17        }
18      }
19    }
20  }
21}

The search query uses these arguments.

  • channelIds - (Required) Array of CMS channel IDs to search. Specify up to 5 IDs.
  • keyword - (Required) Search keyword to match against content. Must be between 3-5000 characters.
  • language - The language variant of the content. The format is an IETF locale code, such as en_US, fr, pt_BR.
  • pagination - Controls the number of results returned and the starting offset.
    • limit - Controls how many items are returned per page. Must be between 1-25. The default is 10.
    • offset- Zero-based starting position. Must be greater than or equal to 0. The default is 0.
  • taxonomyExpression - A JSON encoded string filter for ContentTaxonomyTerm IDs. Values must be taxonomy term IDs, not term labels. Supports operators: AND, OR, NOT, parent, taxonomy
  • contentTypeFQNs - An array of CMS content types. Specify between 1-50 strings. You don’t need to specify an exact match of a content type’s fully qualified name (FQN). For example, if you specify “news,” the search result returns content of type sfdc_cms__image.

Search with Multiple Arguments 

This example shows how to combine multiple arguments to refine your search. In this case, the API searches for English news content in 2 channels. The paginated search results show 20 items per page, and they include content delivery and channel details.

Search with multiple filters
1query searchWithFilters {
2  managed_content {
3    search {
4      searchContentInChannels(
5        searchIdentifiers:{
6          channelIds: ["0apxx0000000002AAA","0apxx0000000001AAA"]
7        }
8        keyword: "product announcement"
9        language: "en_US"
10        contentTypeFQNs: ["sfdc_cms__news"]
11        pagination: { limit: 20, offset: 0 }
12      ) {
13        total
14        offset
15        pageSize
16        items {
17          managedContentId
18          title
19          contentType
20          language
21          managedContentChannelDeliveryDetails {
22            contentUrl
23            publishedDate
24            managedContentChannelDetails {
25              id
26              name
27            }
28          }
29        }
30      }
31    }
32  }
33}

See Also