index more words from thesaurus (#4570)
This commit is contained in:
parent
dbf6acb98f
commit
ca14ea0a5c
|
@ -61,6 +61,22 @@ class DmsKeyword(Item):
|
|||
""" """
|
||||
implements(IDmsKeyword)
|
||||
|
||||
def get_words_for_indexation(self, limit=5):
|
||||
thesaurus = aq_parent(self)
|
||||
words = []
|
||||
words.append(self.title)
|
||||
for word in self.equivs or []:
|
||||
words.append(word)
|
||||
if limit > 0:
|
||||
for broader_keyword in self.broader or []:
|
||||
try:
|
||||
keyword = thesaurus[broader_keyword]
|
||||
except KeyError:
|
||||
continue
|
||||
words.append(keyword.get_words_for_indexation(limit=limit-1))
|
||||
return ' '.join(words)
|
||||
|
||||
|
||||
|
||||
class DmsKeywordSchemaPolicy(DexteritySchemaPolicy):
|
||||
""" """
|
||||
|
|
Reference in New Issue