indexer: do not fail on missing thesaurus terms

This commit is contained in:
Frédéric Péters 2014-03-21 11:44:53 +01:00
parent 09fbebe0c7
commit 83c77feaf8
1 changed files with 4 additions and 1 deletions

View File

@ -46,7 +46,10 @@ def document_dynamic_searchable_text_indexer(obj):
factory = getUtility(IVocabularyFactory, 'dms.thesaurus.simple')
vocabulary = factory(obj)
for keyword in obj.keywords:
indexed_elements.append(vocabulary.getTerm(keyword).title)
try:
indexed_elements.append(vocabulary.getTerm(keyword).title)
except LookupError:
continue
return u' '.join(indexed_elements)