mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-22 22:03:35 -04:00
Fixed search in German, French and other languages
This commit is contained in:
@@ -138,11 +138,6 @@ export class Search {
|
||||
this.index = lunr(function() {
|
||||
pipeline = pipeline || ["trimmer", "stopWordFilter"]
|
||||
|
||||
/* Set up pipeline according to configuration */
|
||||
this.pipeline.reset()
|
||||
for (const fn of pipeline)
|
||||
this.pipeline.add(lunr[fn])
|
||||
|
||||
/* Set up alternate search languages */
|
||||
if (config.lang.length === 1 && config.lang[0] !== "en") {
|
||||
this.use((lunr as any)[config.lang[0]])
|
||||
@@ -150,6 +145,16 @@ export class Search {
|
||||
this.use((lunr as any).multiLanguage(...config.lang))
|
||||
}
|
||||
|
||||
/* Set up pipeline according to configuration */
|
||||
this.pipeline.reset()
|
||||
for (const fn of pipeline)
|
||||
this.pipeline.add(lunr[fn])
|
||||
|
||||
/* Set up search pipeline according to configuration */
|
||||
this.searchPipeline.reset()
|
||||
for (const fn of pipeline)
|
||||
this.searchPipeline.add(lunr[fn])
|
||||
|
||||
/* Set up fields and reference */
|
||||
this.field("title", { boost: 1000 })
|
||||
this.field("text")
|
||||
|
||||
Reference in New Issue
Block a user