server/sources/native.py
changeset 5556 9ab2b4c74baf
parent 5542 a8ad3df5a8a3
child 5557 1a534c596bff
equal deleted inserted replaced
5555:a64f48dd5fe4 5556:9ab2b4c74baf
  1163         """
  1163         """
  1164         self.debug('reindexing %r', entity.eid)
  1164         self.debug('reindexing %r', entity.eid)
  1165         try:
  1165         try:
  1166             # use cursor_index_object, not cursor_reindex_object since
  1166             # use cursor_index_object, not cursor_reindex_object since
  1167             # unindexing done in the FTIndexEntityOp
  1167             # unindexing done in the FTIndexEntityOp
  1168             self.dbhelper.cursor_index_object(entity.eid, entity,
  1168             self.dbhelper.cursor_index_object(entity.eid,
       
  1169                                               entity.cw_adapt_to('IFTIndexable'),
  1169                                               session.pool['system'])
  1170                                               session.pool['system'])
  1170         except Exception: # let KeyboardInterrupt / SystemExit propagate
  1171         except Exception: # let KeyboardInterrupt / SystemExit propagate
  1171             self.exception('error while reindexing %s', entity)
  1172             self.exception('error while reindexing %s', entity)
  1172 
  1173 
  1173 
  1174 
  1188             if eid in pendingeids or eid in done:
  1189             if eid in pendingeids or eid in done:
  1189                 # entity added and deleted in the same transaction or already
  1190                 # entity added and deleted in the same transaction or already
  1190                 # processed
  1191                 # processed
  1191                 return
  1192                 return
  1192             done.add(eid)
  1193             done.add(eid)
  1193             for container in session.entity_from_eid(eid).fti_containers():
  1194             iftindexable = session.entity_from_eid(eid).cw_adapt_to('IFTIndexable')
       
  1195             for container in iftindexable.fti_containers():
  1194                 source.fti_unindex_entity(session, container.eid)
  1196                 source.fti_unindex_entity(session, container.eid)
  1195                 source.fti_index_entity(session, container)
  1197                 source.fti_index_entity(session, container)
  1196 
  1198 
  1197 
  1199 
  1198 def sql_schema(driver):
  1200 def sql_schema(driver):