From bba9c154687f4bdc3870e9103993c43a19480cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 25 Mar 2014 16:41:13 +0100 Subject: [PATCH] index more words from thesaurus (#4570) --- src/pfwbged/basecontent/indexers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pfwbged/basecontent/indexers.py b/src/pfwbged/basecontent/indexers.py index 1ccd472..a9df8d7 100644 --- a/src/pfwbged/basecontent/indexers.py +++ b/src/pfwbged/basecontent/indexers.py @@ -9,6 +9,8 @@ from zope.schema.interfaces import IVocabularyFactory from pfwbged.folder import IFolder from collective.dms.basecontent.dmsdocument import IDmsDocument +from plone import api + from .behaviors import IPfwbDocument @@ -44,10 +46,11 @@ def document_dynamic_searchable_text_indexer(obj): if hasattr(obj, 'keywords') and obj.keywords: factory = getUtility(IVocabularyFactory, 'dms.thesaurus.simple') + thesaurus = api.portal.get()['thesaurus'] vocabulary = factory(obj) for keyword in obj.keywords: try: - indexed_elements.append(vocabulary.getTerm(keyword).title) + indexed_elements.append(thesaurus[keyword].get_words_for_indexation()) except LookupError: continue