diff --git a/material/plugins/search/config.py b/material/plugins/search/config.py index 682d9a9e0..f8618185b 100644 --- a/material/plugins/search/config.py +++ b/material/plugins/search/config.py @@ -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)) diff --git a/material/plugins/search/plugin.py b/material/plugins/search/plugin.py index f043e2840..120e7e23d 100644 --- a/material/plugins/search/plugin.py +++ b/material/plugins/search/plugin.py @@ -75,7 +75,7 @@ class SearchPlugin(BasePlugin[SearchConfig]): ) # 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") ))) diff --git a/src/plugins/search/config.py b/src/plugins/search/config.py index 682d9a9e0..f8618185b 100644 --- a/src/plugins/search/config.py +++ b/src/plugins/search/config.py @@ -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)) diff --git a/src/plugins/search/plugin.py b/src/plugins/search/plugin.py index f043e2840..120e7e23d 100644 --- a/src/plugins/search/plugin.py +++ b/src/plugins/search/plugin.py @@ -75,7 +75,7 @@ class SearchPlugin(BasePlugin[SearchConfig]): ) # 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") )))