diff --git a/src/pfwbged/basecontent/indexers.py b/src/pfwbged/basecontent/indexers.py index a9df8d7..0d5a9f9 100644 --- a/src/pfwbged/basecontent/indexers.py +++ b/src/pfwbged/basecontent/indexers.py @@ -66,5 +66,17 @@ def thesaurus_keywords(obj, **kw): return [] if not obj.keywords: return [] - return [x for x in obj.keywords if x] + + keywords = [x for x in obj.keywords if x] + try: + thesaurus = api.portal.get()['thesaurus'] + except KeyError: + pass + else: + for keyword in keywords[:]: + try: + keywords.extend(thesaurus[keyword].get_keyword_tree()) + except KeyError: + continue + return keywords grok.global_adapter(thesaurus_keywords, name='thesaurus_keywords')