server/checkintegrity.py
branchstable
changeset 2248 cbf043a2134a
parent 1977 606923dff11b
child 2476 1294a6bdf3bf
equal deleted inserted replaced
2247:9dbbe6a4c9b0 2248:cbf043a2134a
    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