summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2011-12-21 16:12:34 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2011-12-21 16:12:34 (GMT)
commit7af1ce0df292684d712cefa53d7ddd40202f3be8 (patch)
tree441597661c4075b6c6b230ce5c10ba9c91740e74
parentd61e566514270c0d01be9df50a7bef41bd7b3d76 (diff)
downloadthemis.indexer-7af1ce0df292684d712cefa53d7ddd40202f3be8.zip
themis.indexer-7af1ce0df292684d712cefa53d7ddd40202f3be8.tar.gz
themis.indexer-7af1ce0df292684d712cefa53d7ddd40202f3be8.tar.bz2
also index title and contents of mails to SearchableTextHEADmaster
-rw-r--r--themis/indexer/indexer.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/themis/indexer/indexer.py b/themis/indexer/indexer.py
index 64becf5..08b5b3f 100644
--- a/themis/indexer/indexer.py
+++ b/themis/indexer/indexer.py
@@ -13,6 +13,8 @@ from zope import schema
from zope.component import getAdapters, getMultiAdapter
from zope.interface import alsoProvides
+import themis.search.indexer
+
class FakeView(object):
"""This fake view is used for enabled z3c forms z2 mode on.
@@ -25,17 +27,10 @@ class FakeView(object):
@indexer(IThemisFieldIndexer)
def dynamic_searchable_text_indexer(obj):
- """Dynamic searchable text indexer.
- """
-
- # We need to make sure that we have z2 mode switched on for z3c form.
- # Since we do not really have any view to do this on, we just use
- # a fake view. For switching z2 mode on, it's only necessary that
- # there is a view.request.
- view = FakeView(obj, obj.REQUEST)
- z2.switch_on(view, request_layer=IFormLayer)
+ indexed = [obj.title]
- indexed = []
+ if obj.fichier:
+ indexed.append(themis.search.indexer.get_data_to_index(obj, obj.fichier))
for fieldname in ('numero_courrier', 'mail_ref_id'):
try: