mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-22 13:53:43 -04:00
Fixed search indexing of multi-word tags
This commit is contained in:
@@ -204,7 +204,10 @@ export class Search {
|
||||
/* Set up fields */
|
||||
this.field("title", { boost: 1e3 })
|
||||
this.field("text")
|
||||
this.field("tags", { boost: 1e6 })
|
||||
this.field("tags", { boost: 1e6, extractor: doc => {
|
||||
const { tags = [] } = doc as SearchDocument
|
||||
return tags.flatMap(tag => lunr.tokenizer(tag))
|
||||
} })
|
||||
|
||||
/* Index documents */
|
||||
for (const doc of docs)
|
||||
|
||||
Reference in New Issue
Block a user