mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-30 18:24:35 +01:00
Fixed search stuck in initializing when tags are used
This commit is contained in:
parent
e86896645b
commit
e3ce3dbc25
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -187,7 +187,7 @@
|
||||
"base": base_url,
|
||||
"features": features,
|
||||
"translations": {},
|
||||
"search": "assets/javascripts/workers/search.62afc64d.min.js" | url
|
||||
"search": "assets/javascripts/workers/search.b97dbffb.min.js" | url
|
||||
} -%}
|
||||
{%- if config.extra.version -%}
|
||||
{%- set _ = app.update({ "version": config.extra.version }) -%}
|
||||
|
@ -206,7 +206,10 @@ export class Search {
|
||||
this.field("text")
|
||||
this.field("tags", { boost: 1e6, extractor: doc => {
|
||||
const { tags = [] } = doc as SearchDocument
|
||||
return tags.flatMap(tag => lunr.tokenizer(tag))
|
||||
return tags.reduce((list, tag) => [
|
||||
...list,
|
||||
...lunr.tokenizer(tag)
|
||||
], [] as lunr.Token[])
|
||||
} })
|
||||
|
||||
/* Index documents */
|
||||
|
Loading…
Reference in New Issue
Block a user