69 # to be updated due to the reindexation |
69 # to be updated due to the reindexation |
70 from cubicweb.server.hooks import (setmtime_before_update_entity, |
70 from cubicweb.server.hooks import (setmtime_before_update_entity, |
71 uniquecstrcheck_before_modification) |
71 uniquecstrcheck_before_modification) |
72 from cubicweb.server.repository import FTIndexEntityOp |
72 from cubicweb.server.repository import FTIndexEntityOp |
73 repo = session.repo |
73 repo = session.repo |
|
74 cursor = session.pool['system'] |
|
75 if not repo.system_source.indexer.has_fti_table(cursor): |
|
76 from indexer import get_indexer |
|
77 print 'no text index table' |
|
78 indexer = get_indexer(repo.system_source.dbdriver) |
|
79 # XXX indexer.init_fti(cursor) once index 0.7 is out |
|
80 indexer.init_extensions(cursor) |
|
81 cursor.execute(indexer.sql_init_fti()) |
74 repo.hm.unregister_hook(setmtime_before_update_entity, |
82 repo.hm.unregister_hook(setmtime_before_update_entity, |
75 'before_update_entity', '') |
83 'before_update_entity', '') |
76 repo.hm.unregister_hook(uniquecstrcheck_before_modification, |
84 repo.hm.unregister_hook(uniquecstrcheck_before_modification, |
77 'before_update_entity', '') |
85 'before_update_entity', '') |
78 repo.do_fti = True # ensure full-text indexation is activated |
86 repo.do_fti = True # ensure full-text indexation is activated |