cubicweb/server/sources/native.py
branch3.26
changeset 12290 2b049c9fcec5
parent 12156 0d1d22a3a48b
child 12355 c703dc95c82e
--- a/cubicweb/server/sources/native.py	Thu Apr 19 15:55:33 2018 +0200
+++ b/cubicweb/server/sources/native.py	Wed Dec 13 01:23:39 2017 +0100
@@ -1261,6 +1261,8 @@
     def fti_unindex_entities(self, cnx, entities):
         """remove text content for entities from the full text index
         """
+        if not cnx.repo.system_source.do_fti:
+            return
         cursor = cnx.cnxset.cu
         cursor_unindex_object = self.dbhelper.cursor_unindex_object
         try:
@@ -1272,6 +1274,8 @@
     def fti_index_entities(self, cnx, entities):
         """add text content of created/modified entities to the full text index
         """
+        if not cnx.repo.system_source.do_fti:
+            return
         cursor_index_object = self.dbhelper.cursor_index_object
         cursor = cnx.cnxset.cu
         try:
@@ -1296,6 +1300,8 @@
     def precommit_event(self):
         cnx = self.cnx
         source = cnx.repo.system_source
+        if not source.do_fti:
+            return
         pendingeids = cnx.transaction_data.get('pendingeids', ())
         done = cnx.transaction_data.setdefault('indexedeids', set())
         to_reindex = set()