mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03: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,
|
"base": base_url,
|
||||||
"features": features,
|
"features": features,
|
||||||
"translations": {},
|
"translations": {},
|
||||||
"search": "assets/javascripts/workers/search.62afc64d.min.js" | url
|
"search": "assets/javascripts/workers/search.b97dbffb.min.js" | url
|
||||||
} -%}
|
} -%}
|
||||||
{%- if config.extra.version -%}
|
{%- if config.extra.version -%}
|
||||||
{%- set _ = app.update({ "version": config.extra.version }) -%}
|
{%- set _ = app.update({ "version": config.extra.version }) -%}
|
||||||
|
@ -206,7 +206,10 @@ export class Search {
|
|||||||
this.field("text")
|
this.field("text")
|
||||||
this.field("tags", { boost: 1e6, extractor: doc => {
|
this.field("tags", { boost: 1e6, extractor: doc => {
|
||||||
const { tags = [] } = doc as SearchDocument
|
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 */
|
/* Index documents */
|
||||||
|
Loading…
Reference in New Issue
Block a user