diff --git a/themis/search/indexer.py b/themis/search/indexer.py index abdb934..5c5b1ce 100644 --- a/themis/search/indexer.py +++ b/themis/search/indexer.py @@ -333,3 +333,21 @@ def statusTitleIndexer(obj): return workflow.states[current_state].title grok.global_adapter(statusTitleIndexer, name='statusTitle') + +@indexer(plone.dexterity.interfaces.IDexterityItem) +def mailHandledByTxtIndexer(obj): + if obj.portal_type not in ('courrier_entrant', 'courrier_sortant'): + return None + values = [] + for attr in ('traite__par',): + if not hasattr(obj, attr): + continue + if getattr(obj, attr): + for person in getattr(obj, attr): + values.append(person) + if values: + return ', '.join(values) + else: + return None + +grok.global_adapter(mailHandledByTxtIndexer, name="mailHandledByTxt") diff --git a/themis/search/profiles/default/catalog.xml b/themis/search/profiles/default/catalog.xml index f06c687..6cb1b90 100644 --- a/themis/search/profiles/default/catalog.xml +++ b/themis/search/profiles/default/catalog.xml @@ -67,6 +67,7 @@ +