Last updated

search

Customize search functionality in your project. By default, search appears in the top navigation bar in the far right corner.

Use the search configuration to:

  • Hide the search bar
  • Add keyboard shortcuts for search activation
  • Add suggested pages to the search modal

Options

OptionTypeDescription
enginestringSpecifies the search engine type. Typesense requires an Enterprise or Enterprise+ plan. Possible values: flexsearch, typesense. Default: flexsearch.
hidebooleanHides the search bar when set to true. Default: false.
shortcuts[string]Keyboard shortcuts that activate search (for example, ctrl+f). Default: /.
suggestedPages[Page item]List of suggested pages.
filters[Filter item]Advanced filter configuration.
ai[AI search options]AI search options.

Page item object

OptionTypeDescription
pagestringREQUIRED. Path to the file representing the linked page.
labelstringLink text displayed for the item.
labelTranslationKeystringLink text key used for localization.

Filter item object

OptionTypeDescription
hidebooleanHides the search filter panel when set to true. Default: false.
facets[Facet item]List of user-defined search facets.

Facet item object

OptionTypeDescription
namestringREQUIRED. Name of the facet. Acts as a label for the filtering control in the search dialog.
fieldstringREQUIRED. Facet ID. Use this ID as a key in metadata section when adding facets to a page.
typestringREQUIRED. Control displayed in the search dialog. Values: multi-select (select multiple filter values), select (select a single filter value), tags (applies only to HTTP method facet).
isTopbooleanIndicates whether the facet is a top-level facet.

AI search options

OptionTypeDescription
hidebooleanHides the AI search button when set to true. Default: true
promptstringBuilt-in instructions for AI search. Applied to all AI searches in the project and not visible to users. Use to set greeting, tone, or other answer conditions.
suggestions[string]List of suggestions displayed in the AI search interface.

Examples

Hide the search bar:

search:
  hide: true

Set keyboard shortcuts for search:

search:
  shortcuts:
    - ctrl+f
    - cmd+k
    - /

Set suggested pages for the search modal:

search:
  suggestedPages:
    - label: Home page
      page: index.page.tsx
    - page: /catalog/

Display the AI search button with a custom prompt:

search:
  ai:
    hide: false
    prompt: Speak only in rhymes

Set AI search suggestions:

search:
  ai:
    hide: false
    suggestions:
      - How to create a new API?
      - What is Redocly?
      - How to manage an organization?

Override default search facets:

search:
  filters:
    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

Resources