server/checkintegrity.py
changeset 8450 11063635c4e4
parent 8447 4fb20c09017a
child 8527 6151b0199bc1
--- a/server/checkintegrity.py	Fri Jul 06 09:00:32 2012 +0200
+++ b/server/checkintegrity.py	Fri Jul 06 09:00:33 2012 +0200
@@ -134,10 +134,12 @@
     # attribute to their current value
     source = repo.system_source
     for eschema in etypes:
-        rset = session.execute('Any X WHERE X is %s' % eschema)
-        source.fti_index_entities(session, rset.entities())
-        # clear entity cache to avoid high memory consumption on big tables
-        session.drop_entity_cache()
+        etype_class = session.vreg['etypes'].etype_class(str(eschema))
+        for fti_rql in etype_class.cw_fti_index_rql_queries(session):
+            rset = session.execute(fti_rql)
+            source.fti_index_entities(session, rset.entities())
+            # clear entity cache to avoid high memory consumption on big tables
+            session.drop_entity_cache()
         if withpb:
             pb.update()