contentSearch
The published pages and articles that match searchTerm, at most limit (and never more than 20), and where the CMS's keyword list sends the term. Answered by the CMS's own search, or by a search engine that indexes the content.
Arguments
| Argument | Type | Description |
|---|---|---|
searchTerm | String! | |
limit | Int! | Default 3 |
Returns
| Field | Type | Description |
|---|---|---|
hits | [ContentSearchHit!]! | The best matching pages and articles, at most limit. |
redirect | SearchRedirect | Where the CMS's keyword list sends this search term. Null where none matches. |
Example
query ContentSearch($searchTerm: String!, $limit: Int!) { contentSearch(searchTerm: $searchTerm, limit: $limit) { hits { excerpt } redirect { kind path pageType } }}{ "searchTerm": "Example", "limit": 1}{ "data": { "contentSearch": { "hits": [ { "excerpt": "Example" } ], "redirect": { "kind": "PAGE", "path": "/example", "pageType": "CONTENT" } } }}The query selects the return type's fields two levels deep; pick the ones you need. The response shows its shape with placeholder values.
Used by
The storefront packages that send it, in these GraphQL documents:
- @evolve-storefront/feature-content-blocks:
ContentBlocksContentSearch

