ui.modern.session.search_history.suggest.display_template

Background

You can specify a template for search history suggestions to define how each suggestion should be displayed when ui.modern.session.search_history.suggest is enabled

It’s using a micro-templating system allowing you to choose which fields should be displayed for each suggestions.

The following tokens are available:

  • query: Previous query run

  • totalMatching: Number of results the query yielded

Tokens are used in curly brackets, e.g. {query}. The modern UI will replace the token with actual values when rendering the suggestions.

Setting the key

Set this configuration key in the results page (preferred) or search package configuration.

Use the configuration key editor to add or edit the ui.modern.session.search_history.suggest.display_template key, and set the value. This can be set to any valid String value.

Default value

ui.modern.session.search_history.suggest.display_template={query} <small>({totalMatching})</small>

Examples

Only display the query in italics:

ui.modern.session.search_history.suggest.display_template=<em>{query}</em>