mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed inability to reset search pipeline
This commit is contained in:
parent
c8bae9b5b4
commit
f3252381da
@ -46,7 +46,7 @@ class SearchConfig(Config):
|
|||||||
# Settings for search
|
# Settings for search
|
||||||
lang = Optional(LangOption())
|
lang = Optional(LangOption())
|
||||||
separator = Optional(Type(str))
|
separator = Optional(Type(str))
|
||||||
pipeline = ListOfItems(Choice(pipeline), default = [])
|
pipeline = Optional(ListOfItems(Choice(pipeline)))
|
||||||
|
|
||||||
# Settings for text segmentation (Chinese)
|
# Settings for text segmentation (Chinese)
|
||||||
jieba_dict = Optional(Type(str))
|
jieba_dict = Optional(Type(str))
|
||||||
|
@ -75,7 +75,7 @@ class SearchPlugin(BasePlugin[SearchConfig]):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Retrieve default value for pipeline
|
# Retrieve default value for pipeline
|
||||||
if not self.config.pipeline:
|
if self.config.pipeline is None:
|
||||||
self.config.pipeline = list(filter(len, re.split(
|
self.config.pipeline = list(filter(len, re.split(
|
||||||
r"\s*,\s*", self._translate(config, "search.config.pipeline")
|
r"\s*,\s*", self._translate(config, "search.config.pipeline")
|
||||||
)))
|
)))
|
||||||
|
@ -46,7 +46,7 @@ class SearchConfig(Config):
|
|||||||
# Settings for search
|
# Settings for search
|
||||||
lang = Optional(LangOption())
|
lang = Optional(LangOption())
|
||||||
separator = Optional(Type(str))
|
separator = Optional(Type(str))
|
||||||
pipeline = ListOfItems(Choice(pipeline), default = [])
|
pipeline = Optional(ListOfItems(Choice(pipeline)))
|
||||||
|
|
||||||
# Settings for text segmentation (Chinese)
|
# Settings for text segmentation (Chinese)
|
||||||
jieba_dict = Optional(Type(str))
|
jieba_dict = Optional(Type(str))
|
||||||
|
@ -75,7 +75,7 @@ class SearchPlugin(BasePlugin[SearchConfig]):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Retrieve default value for pipeline
|
# Retrieve default value for pipeline
|
||||||
if not self.config.pipeline:
|
if self.config.pipeline is None:
|
||||||
self.config.pipeline = list(filter(len, re.split(
|
self.config.pipeline = list(filter(len, re.split(
|
||||||
r"\s*,\s*", self._translate(config, "search.config.pipeline")
|
r"\s*,\s*", self._translate(config, "search.config.pipeline")
|
||||||
)))
|
)))
|
||||||
|
Loading…
Reference in New Issue
Block a user