server/checkintegrity.py
changeset 8450 11063635c4e4
parent 8447 4fb20c09017a
child 8527 6151b0199bc1
equal deleted inserted replaced
8449:cc83a3f16c0f 8450:11063635c4e4
   132         pb.update()
   132         pb.update()
   133     # reindex entities by generating rql queries which set all indexable
   133     # reindex entities by generating rql queries which set all indexable
   134     # attribute to their current value
   134     # attribute to their current value
   135     source = repo.system_source
   135     source = repo.system_source
   136     for eschema in etypes:
   136     for eschema in etypes:
   137         rset = session.execute('Any X WHERE X is %s' % eschema)
   137         etype_class = session.vreg['etypes'].etype_class(str(eschema))
   138         source.fti_index_entities(session, rset.entities())
   138         for fti_rql in etype_class.cw_fti_index_rql_queries(session):
   139         # clear entity cache to avoid high memory consumption on big tables
   139             rset = session.execute(fti_rql)
   140         session.drop_entity_cache()
   140             source.fti_index_entities(session, rset.entities())
       
   141             # clear entity cache to avoid high memory consumption on big tables
       
   142             session.drop_entity_cache()
   141         if withpb:
   143         if withpb:
   142             pb.update()
   144             pb.update()
   143 
   145 
   144 
   146 
   145 def check_schema(schema, session, eids, fix=1):
   147 def check_schema(schema, session, eids, fix=1):