[entities] make sure log files are *not* indexed (FTI)
authorDavid Douard <david.douard@logilab.fr>
Wed, 23 Oct 2013 16:09:14 +0200
changeset 1503 70da3e54219b
parent 1501 a45f5a997ab2
child 1508 235c766b52ff
[entities] make sure log files are *not* indexed (FTI)
entities.py
--- a/entities.py	Wed Apr 30 15:44:54 2014 +0200
+++ b/entities.py	Wed Oct 23 16:09:14 2013 +0200
@@ -19,6 +19,8 @@
 from cubicweb.uilib import domid
 from cubicweb.entity import _marker
 from cubicweb.entities import AnyEntity, fetch_config
+from cubicweb.entities.adapters import IFTIndexableAdapter
+from cubicweb.predicates import has_related_entities, is_instance
 
 from cubes.narval.entities import Plan
 
@@ -513,3 +515,10 @@
     @property
     def to_environment(self):
         return self.on_environment[0]
+
+class NoIndexLogFileIndexableAdapter(IFTIndexableAdapter):
+    __select__ = is_instance('File') & has_related_entities('log_file', 'object')
+
+    def get_words(self):
+        return {}
+