# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1238054885 -3600 # Node ID 77bf88f01fcc6979cf18684b0e12adc367b24edb # Parent 16a426d214aeb6a896e7b58628ea997cbce9a0a7 new delay-full-text-indexation configuration option diff -r 16a426d214ae -r 77bf88f01fcc server/repository.py --- a/server/repository.py Wed Mar 25 16:13:23 2009 +0100 +++ b/server/repository.py Thu Mar 26 09:08:05 2009 +0100 @@ -211,7 +211,8 @@ self._get_pool().close(True) for i in xrange(config['connections-pool-size']): self._available_pools.put_nowait(ConnectionsPool(self.sources)) - + self.do_fti = config['delay-full-text-indexation'] + # internals ############################################################### def get_source(self, uri, source_config): @@ -829,7 +830,8 @@ entity.complete(entity.e_schema.indexable_attributes()) session.add_query_data('neweids', entity.eid) # now we can update the full text index - FTIndexEntityOp(session, entity=entity) + if self.do_fti: + FTIndexEntityOp(session, entity=entity) CleanupEidTypeCacheOp(session) def delete_info(self, session, eid): @@ -995,7 +997,7 @@ entity) source.update_entity(session, entity) if not only_inline_rels: - if need_fti_update: + if need_fti_update and self.do_fti: # reindex the entity only if this query is updating at least # one indexable attribute FTIndexEntityOp(session, entity=entity) diff -r 16a426d214ae -r 77bf88f01fcc server/serverconfig.py --- a/server/serverconfig.py Wed Mar 25 16:13:23 2009 +0100 +++ b/server/serverconfig.py Thu Mar 26 09:08:05 2009 +0100 @@ -73,6 +73,15 @@ 'help': 'size of the parsed rql cache size.', 'group': 'main', 'inputlevel': 1, }), + ('delay-full-text-indexation', + {'type' : 'yn', 'default': False, + 'help': 'When full text indexation of entity has a too important cost' + ' to be done when entity are added/modified by users, activate this ' + 'option and setup a job using cubicweb-ctl db-rebuild-fti on your ' + 'system (using cron for instance).', + 'group': 'main', 'inputlevel': 1, + }), + # email configuration ('default-recipients-mode', {'type' : 'choice',