search
By default, search is added to your project in the top navigation bar in the far right side corner. You can use the search
configuration to customize search in the following ways:
- hide the search bar
- add a list of shortcuts for activating search
- add a list of suggested pages to the search modal
Options
Option | Type | Description |
---|---|---|
engine | string | Specifies the type of search engine. Typesense requires an Enterprise or Enterprise+ plan. Possible values: flexsearch , typesense . Default: flexsearch . |
hide | boolean | Specifies if the search bar should be hidden. Default: false . |
shortcuts | [string] | List of keyboard shortcuts to activate search (for example, ctrl+f ). Default: / . |
suggestedPages | [Page item] | List of suggested pages. |
filter | [Filter item] | Specifies advanced filter configuration. |
ai | [AI search options] | Specifies AI search options. |
Page item object
Option | Type | Description |
---|---|---|
page | string | REQUIRED. Path to the file which represents the page to link to. |
label | string | Link text displayed for the item. |
labelTranslationKey | string | Link text key for the item used for localization. |
Filter item object
Option | Type | Description |
---|---|---|
hide | boolean | Specifies if the search filter panel is hidden. Default: false . |
facets | [Facet item] | List of user-defined search facets. |
Facet item object
Option | Type | Description |
---|---|---|
name | string | REQUIRED. Name of the facet. It also acts as a label for the filtering control in the search dialog. |
field | string | REQUIRED. The ID of the facet. Use this ID as a key in metadata section when adding facets to the page. |
type | string | REQUIRED. Control displayed in the search dialog. The possible values are: multi-select (allows for selecting multiple filter values in the same facet), select (allows for selecting a single filter value in a facet), tags (applies only to the HTTP method facet). |
isTop | boolean | Indicates whether the facet is a top-level facet. |
AI search options
The AI search feature is currently behind a feature flag. To request access to this feature, contact Redocly at team@redocly.com.
Option | Type | Description |
---|---|---|
hide | boolean | Specifies if the AI search button is hidden. Default: true |
prompt | string | Text specifying the built-in instructions for the AI search. This prompt applies to all AI searches in the project and is not visible to the user. You can use this option, for example, to set a greeting, the tone of the answer, or any other conditions influencing the answer. |
Examples
The following configuration hides the search bar.
search:
hide: true
The following configuration sets keyboard shortcuts that trigger search:
search:
shortcuts:
- ctrl+f
- cmd+k
- /
The following configuration sets suggested pages for the search modal window:
search:
suggestedPages:
- label: Home page
page: index.page.tsx
- page: /catalog/
The following configuration displays the AI search button and sets the built-in prompt for the search:
search:
ai:
hide: false
prompt: Speak only in rhymes
The following configuration overrides the default search facets:
search:
filter:
facets:
- name: Category
field: redocly_category
type: multi-select
- name: HTTP Method
field: httpMethod
type: tags
- name: HTTP Path
field: httpPath
type: multi-select
- name: API Title
field: apiTitle
type: multi-select
- name: API Version
field: apiVersion
type: select
Related options
- Explore the search facets configuration for detailed guidance on how to configure search facets.
- Learn more about the options for adding translated content in the l10n reference documentation.
- Find other options for adding items to the top navigation menu in the navbar reference documentation.
Resources
- Discover all the ways you can customize your project's navigation in the Configure navigation how-to documentation.
- View a list of the UI interface items you can translate in the Predefined translation keys list reference documentation.