index more words from thesaurus (#4570)
This commit is contained in:
parent
83c77feaf8
commit
bba9c15468
|
@ -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
|
||||
|
||||
|
|
Reference in New Issue