Skip to content

Commit

Permalink
Fixed inability to reset search pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Mar 12, 2024
1 parent c8bae9b commit f325238
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion material/plugins/search/config.py
Expand Up @@ -46,7 +46,7 @@ class SearchConfig(Config):
# Settings for search
lang = Optional(LangOption())
separator = Optional(Type(str))
pipeline = ListOfItems(Choice(pipeline), default = [])
pipeline = Optional(ListOfItems(Choice(pipeline)))

# Settings for text segmentation (Chinese)
jieba_dict = Optional(Type(str))
Expand Down
2 changes: 1 addition & 1 deletion material/plugins/search/plugin.py
Expand Up @@ -75,7 +75,7 @@ def on_config(self, config):
)

# Retrieve default value for pipeline
if not self.config.pipeline:
if self.config.pipeline is None:
self.config.pipeline = list(filter(len, re.split(
r"\s*,\s*", self._translate(config, "search.config.pipeline")
)))
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/search/config.py
Expand Up @@ -46,7 +46,7 @@ class SearchConfig(Config):
# Settings for search
lang = Optional(LangOption())
separator = Optional(Type(str))
pipeline = ListOfItems(Choice(pipeline), default = [])
pipeline = Optional(ListOfItems(Choice(pipeline)))

# Settings for text segmentation (Chinese)
jieba_dict = Optional(Type(str))
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/search/plugin.py
Expand Up @@ -75,7 +75,7 @@ def on_config(self, config):
)

# Retrieve default value for pipeline
if not self.config.pipeline:
if self.config.pipeline is None:
self.config.pipeline = list(filter(len, re.split(
r"\s*,\s*", self._translate(config, "search.config.pipeline")
)))
Expand Down

0 comments on commit f325238

Please sign in to comment.