From: hernani Date: Mon, 28 Jun 2010 10:55:50 +0000 (+0000) Subject: Forces the FTS reindexing after an import. X-Git-Tag: live~679 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/e5cc8710975219230af1bbf7212dc22e5696b5c1 Forces the FTS reindexing after an import. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@455 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum_modules/sximporter/importer.py b/forum_modules/sximporter/importer.py index 5277b8d..2d8c903 100644 --- a/forum_modules/sximporter/importer.py +++ b/forum_modules/sximporter/importer.py @@ -854,6 +854,13 @@ def reset_sequences(): db.execute_many(PG_SEQUENCE_RESETS) db.commit_transaction() +def reindex_fts(): + from south.db import db + if db.backend_name == "postgres": + db.start_transaction() + db.execute_many("UPDATE forum_node_revision set id = id WHERE TRUE;") + db.commit_transaction() + def sximport(dump, options): try: @@ -890,6 +897,7 @@ def sximport(dump, options): if triggers_disabled: enable_triggers() + reindex_fts() PG_DISABLE_TRIGGERS = """