914 (entity.eid, eschema_eid(cnx, eschema))) |
914 (entity.eid, eschema_eid(cnx, eschema))) |
915 if 'CWSource' in self.schema and source.eid is not None: # else, cw < 3.10 |
915 if 'CWSource' in self.schema and source.eid is not None: # else, cw < 3.10 |
916 self._handle_is_relation_sql(cnx, 'INSERT INTO cw_source_relation(eid_from,eid_to) VALUES (%s,%s)', |
916 self._handle_is_relation_sql(cnx, 'INSERT INTO cw_source_relation(eid_from,eid_to) VALUES (%s,%s)', |
917 (entity.eid, source.eid)) |
917 (entity.eid, source.eid)) |
918 # now we can update the full text index |
918 # now we can update the full text index |
919 if self.do_fti and self.need_fti_indexation(entity.cw_etype): |
919 if self.need_fti_indexation(entity.cw_etype): |
920 self.index_entity(cnx, entity=entity) |
920 self.index_entity(cnx, entity=entity) |
921 |
921 |
922 def update_info(self, cnx, entity, need_fti_update): |
922 def update_info(self, cnx, entity, need_fti_update): |
923 """mark entity as being modified, fulltext reindex if needed""" |
923 """mark entity as being modified, fulltext reindex if needed""" |
924 if self.do_fti and need_fti_update: |
924 if need_fti_update: |
925 # reindex the entity only if this query is updating at least |
925 # reindex the entity only if this query is updating at least |
926 # one indexable attribute |
926 # one indexable attribute |
927 self.index_entity(cnx, entity=entity) |
927 self.index_entity(cnx, entity=entity) |
928 |
928 |
929 def delete_info_multi(self, cnx, entities): |
929 def delete_info_multi(self, cnx, entities): |
1317 |
1317 |
1318 def index_entity(self, cnx, entity): |
1318 def index_entity(self, cnx, entity): |
1319 """create an operation to [re]index textual content of the given entity |
1319 """create an operation to [re]index textual content of the given entity |
1320 on commit |
1320 on commit |
1321 """ |
1321 """ |
1322 FTIndexEntityOp.get_instance(cnx).add_data(entity.eid) |
1322 if self.do_fti: |
|
1323 FTIndexEntityOp.get_instance(cnx).add_data(entity.eid) |
1323 |
1324 |
1324 def fti_unindex_entities(self, cnx, entities): |
1325 def fti_unindex_entities(self, cnx, entities): |
1325 """remove text content for entities from the full text index |
1326 """remove text content for entities from the full text index |
1326 """ |
1327 """ |
1327 cursor = cnx.cnxset.cu |
1328 cursor = cnx.cnxset.cu |