Skip to content
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

Multilingual search #95

Closed
ghost opened this issue Nov 25, 2022 · 8 comments
Closed

Multilingual search #95

ghost opened this issue Nov 25, 2022 · 8 comments

Comments

@ghost
Copy link

ghost commented Nov 25, 2022

Hello,

the documentation does not mention how to customize the search. By default search points to https://abridge.netlify.app/. It seems to me that the search_bundle.min.js needs to be adjusted. But how it this done properly?

@Jieiku
Copy link
Owner

Jieiku commented Nov 25, 2022

You have to configure the site in the config.toml file

base_url = "https://abridge.netlify.app"

You will find there are many things in this file that have to be adjusted.

https://www.getzola.org/documentation/getting-started/configuration/

If you did not yet read over the Abridge readme, pay particular attention to this section:

https://github.com/Jieiku/abridge#step-6-add-provisions-for-search_facadejs-dynamic-ondemand-loading-of-search-related-js-or-disable-the-facade

I use npm as outlined to generate a new bundle, but if you would rather not have to do this, then you can set js_search_facade = false

@ghost
Copy link
Author

ghost commented Nov 25, 2022

I have already configured my (multilingual) website with your nice theme. Everything is ready except the search…

In order to run npm run abridge there needs to be installed the package abridge — is it this abridge package? This confuses me a bit as this package is 10 years old…

Please bear with me as I am not a programmer and thank you for your help.

Edit:
Setting js_search_facade to false in the config.toml made the search work — however only for the default language. How do I enable it for the other languages?

@Jieiku
Copy link
Owner

Jieiku commented Nov 25, 2022

npm run abridge should be ran from the abridge zola theme directory, the reason for this is because that is where the package.json file is which defines the abridge script:

If you inspect the package.json file you will see under "scripts": { all of the defined npm scripts, including the abridge script:

https://github.com/Jieiku/abridge/blob/master/package.json

so for example:

git clone https://github.com/Jieiku/abridge
cd abridge
zola build
npm run abridge
zola build

@ghost ghost changed the title How to customize the search? Multilingual search Nov 25, 2022
@Jieiku
Copy link
Owner

Jieiku commented Nov 25, 2022

I am uncertain as to why it would not work with multilingual, I can try to reproduce the issue locally and help resolve it, but it may take me a few days, I am currently fighting a cold.

I do know that elasticlunr does support multilingual, but there may be something you need to do to enable this support. You may try searching some of the zola documentation for search multilingual support.

report back if you are able to figure it out, and if I get feeling well enough to help investigate I will let you know.

@ghost
Copy link
Author

ghost commented Nov 25, 2022

Alright, I successfully ran npm run abridge and search_facade.js was generated. The search works fine now but as mentioned only for the default language.

I will try to find out how to configure a multilingual search. If find anything I will let you know. Get well soon!

@Jieiku
Copy link
Owner

Jieiku commented Feb 6, 2023

Closing for now because I don't have time to try and figure it out, but if you do make changes that better support multilingual search then please send a pull request :)

My understanding was that the default zola search library elasticsearch should already support multiple languages.

@Jieiku Jieiku closed this as completed Feb 6, 2023
@Jieiku Jieiku mentioned this issue Apr 8, 2023
@Jieiku
Copy link
Owner

Jieiku commented Apr 8, 2023

I added this to my todo list for the Refactor.

@Jieiku
Copy link
Owner

Jieiku commented Apr 8, 2023

Also it appears if your other language is Chinese or Japanese that you have to build Zola to support indexing those: https://www.getzola.org/documentation/content/multilingual/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant