diff --git a/material/plugins/search/plugin.py b/material/plugins/search/plugin.py index 7f6bc6589..8b5a19b36 100644 --- a/material/plugins/search/plugin.py +++ b/material/plugins/search/plugin.py @@ -45,7 +45,7 @@ class SearchIndex(BaseIndex): entry = self._entries[index] # Add document tags - if "tags" in page.meta: + if page.meta.get("tags"): entry["tags"] = page.meta["tags"] # Add document boost for search diff --git a/src/plugins/search/plugin.py b/src/plugins/search/plugin.py index 7f6bc6589..8b5a19b36 100644 --- a/src/plugins/search/plugin.py +++ b/src/plugins/search/plugin.py @@ -45,7 +45,7 @@ class SearchIndex(BaseIndex): entry = self._entries[index] # Add document tags - if "tags" in page.meta: + if page.meta.get("tags"): entry["tags"] = page.meta["tags"] # Add document boost for search