summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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: