Search configuration
Index format, asset paths and language modules.
On this page
Search
Enable Zola's JavaScript Elasticlunr index in zola.toml:
build_search_index = true
[search]
index_format = "elasticlunr_javascript"
include_title = true
include_description = true
include_content = true
The search field is rendered when index generation and extra.devlab.search.enabled
are both enabled. An explicitly different index format removes the control and
its scripts. DevLab uses search_index.<lang>.js for the active language.
Field under extra.devlab.search | Default | Purpose |
|---|---|---|
enabled | true | Renders the search interface and its loader. |
index | Empty | Overrides the generated JavaScript filename; does not convert index formats. |
language_scripts.<lang> | German/Russian modules for de/ru and their regional variants; empty for other languages | Ordered local plugin paths for the language's index. |
The engine, language modules, index and adapter load on the first search focus or keyboard shortcut. Interface controls describes keyboard navigation. For loading failures, see Troubleshooting.
Search languages
English is built into Zola's browser engine. German and Russian load the shared
stemmer support and their matching language module. Regional codes use their
base language's modules: ru-RU loads the Russian modules, and de-DE loads the
German modules. The generated filename still uses the full code, for example
search_index.ru-RU.js. This works for a regional primary language and for
translations. The generated index and runtime pipeline must agree. See
Zola's search documentation.
For another indexed language, put compatible Lunr modules in the site's
static/ folder and configure their order:
[extra.devlab.search.language_scripts]
fr = ["js/lunr.stemmer.support.js", "js/lunr.fr.js"]
The engine loads before this list. The language index and search adapter follow
it. A configured list replaces the built-in defaults. For a regional code,
DevLab first looks for the full code, then its base language. A fr list also
applies to fr-CA, unless language_scripts."fr-CA" provides its own list.
An explicitly empty list takes precedence too: it disables plugin loading for
that code, so the chosen index must work without those plugins.
Some languages need additional tokenizers. Consult the upstream language modules. Interface translations and search pipelines are configured separately.