-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Bug Report
Environment
Zola version: 0.22.1 (also affects current next branch)
Expected Behavior
When building a multi-language site with search enabled and multiple indexed fields (title, description, path, content), the build should complete successfully and generate search indexes for all configured languages.
Example output:
Building site...
-> Creating 76 pages (0 orphan) and 19 sections
Done in 1.7s.
Search indexes created:
public/search_index.en.jspublic/search_index.es.js
Current Behavior
Build crashes with an index out of bounds panic:
Building site...
-> Creating 76 pages (0 orphan) and 19 sections
thread 'main' panicked at elasticlunr-rs-3.0.2/src/lib.rs:317:37:
index out of bounds: the len is 2 but the index is 2
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Example GH action run: https://github.com/welpo/tabi/actions/runs/21471469174/job/61846221224
Steps to Reproduce
Minimal Configuration
Create a config.toml with:
base_url = "https://example.com"
build_search_index = true
default_language = "en"
[search]
include_title = true
include_description = true
include_path = true
include_content = true
[languages.es]
build_search_index = trueContent Structure
content/
_index.md
blog/
_index.md
post.md
post.es.md
Run
zola buildResult
Panic with "index out of bounds: the len is 2 but the index is 2"
Additional context
This is a regression:
- ✅ Zola v0.22.0: Works correctly
- ❌ Zola v0.22.1: Broken
- ❌ Current
nextbranch: Broken
Introduced in: PR #3085 (commit 790de70)
Root cause: Configuration mismatch in components/search/src/elasticlunr.rs where build_fields() uses language_options.search but fill_index() uses config.search, causing field count mismatch when building indexes for non-default languages.
Workarounds:
-
Use only 2 indexed fields (title + content):
[search] include_title = true include_description = false include_path = false include_content = true
-
Disable multi-language search:
[languages.es] build_search_index = false
-
Downgrade to v0.22.0
Creating PR to fix this soon.