-
Notifications
You must be signed in to change notification settings - Fork 963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Search][I18n] Bad search_index.{{lang}}.js content if lang is not en #1740
Comments
For what it's worth, changing this line from
to
fixes the issue. Not sure if it's the right approach tho. |
Can you try adding the French stemmer of elasticlunr to see if that solves it: https://github.com/MihaiValentin/lunr-languages ? Or https://github.com/weixsong/lunr-languages I'm not sure if the first one is meant to work with elasticlunr |
To be fair I've no idea what you're asking me to do right now. I'd gladly give it a try if I ever catch what you mean. |
Only the english version is built-in afaik, for other languages you need to add an additional JS like shown in https://github.com/weixsong/lunr-languages#in-a-web-browser |
Okay, you mean to change the code in my I'll give it a try asap. |
It works just fine using https://github.com/weixsong/lunr-languages#in-a-web-browser. Thanks a lot! |
Just re-opening to make sure it's added to the docs |
I'm not really aware of licensing stuff but this repo is under MPL. Do you have any idea if one could ship it with a |
It should not be an issue |
Bug Report
Environment
Zola version: 0.15 (was already present in 0.14)
Expected Behavior
Generation of the
search_index.{{lang}}.js
should not post-fixpipelines
array with-{{lang}}
.Current Behavior
When you set the default language to
"en"
and generate the search index you have something like"pipeline":["trimmer","stopWordFilter","stemmer"]
close to the file's beginning.But if you set de default language to, say,
"fr"
you get such a content:"pipeline":["trimmer-fr","stopWordFilter-fr","stemmer-fr"]
.Not the
-fr
post-fixes.Now, if you ever add the following lines to a template file:
With
search.js
containing the single following line:You get the following error:
Uncaught Error: Cannot load un-registered function: trimmer-fr
.Removing all
-{{ lang }}
in thesearch_index.{{lang}}.js
solves the problem.The text was updated successfully, but these errors were encountered: