From 4c76f05065c4eb7b12695470b0f32c764a5bb250 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 17 Jul 2022 12:46:27 +0200 Subject: Setup English for search index --- assets/js/search.js | 7 +------ exampleSite/config/_default/params.yaml | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/assets/js/search.js b/assets/js/search.js index 6cca4a5..b0855d2 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -14,13 +14,8 @@ async function initSearchIndex() { searchIndex = lunr(function () { // eslint-disable-line no-undef // Set up the pipeline for indexing content in multiple languages if (Array.isArray(searchConfig.lunrLanguages)) { - // Lunr has full support for the indexing and searching of - // documents in English. So no need add 'en'. - let langs = searchConfig.lunrLanguages.slice(); - langs = langs.filter(lang => lang !== 'en'); - const pipeline = lunr.multiLanguage( // eslint-disable-line no-undef - ...langs + ...searchConfig.lunrLanguages ); this.use(pipeline); diff --git a/exampleSite/config/_default/params.yaml b/exampleSite/config/_default/params.yaml index 8a7d1b8..dd6c5a2 100644 --- a/exampleSite/config/_default/params.yaml +++ b/exampleSite/config/_default/params.yaml @@ -105,12 +105,12 @@ search: maxSummaryLength: 100 # Lunr has full support for the indexing and searching of documents # in English. If your documents are in another language, uncomment - # required languages below. No need add 'en' as its supported by Lunr - # out of box. + # required languages below. # # For more see: https://lunrjs.com/guides/language_support.html languages: # - de + - en - es # - fr # - it -- cgit v1.2.3