Lunr search with support for other languages than English
I've created a Hugo site with Docsy in Swedish and would like to change Lunr search language from English to Swedish. Is it possible to configure somehow? I've been looking around but not found anyone describing how one could do it.
Lunr support more languages than English and I've also found a Swedish stemmer
- https://lunrjs.com/guides/language_support.html
- https://github.com/MihaiValentin/lunr-languages/blob/master/lunr.sv.js
@tekezo, do you know how users could configure this? Thanks!
There is no configuration item at the moment, and I think you can get it to work by modifying the following part locally.
https://github.com/google/docsy/blob/0b5c79c76173088226a1951636d0f29d77165808/assets/js/offline-search.js#L47 https://github.com/google/docsy/blob/0b5c79c76173088226a1951636d0f29d77165808/layouts/partials/head.html#L34
It would be preferable if lunr-languages were automatically adapted from the content languages, so I would like to make such a modification in the future.
Hmm. I didn't think of this when I added offline search in https://github.com/google/docsy/pull/142.
@tekezo Perhaps one way to deal with this could be to enable multilanguage support?
https://lunrjs.com/guides/language_support.html