Ensure FTS parsers and templates are removed prior to creating them when testing.
parent
c34fdaf37d
commit
6887920295
|
@ -27,6 +27,9 @@ def create_fts_parser(server, db_name, schema_name, fts_parser_name):
|
||||||
server['port'])
|
server['port'])
|
||||||
pg_cursor = connection.cursor()
|
pg_cursor = connection.cursor()
|
||||||
|
|
||||||
|
query = "DROP TEXT SEARCH PARSER IF EXISTS " + schema_name + "." + fts_parser_name
|
||||||
|
pg_cursor.execute(query)
|
||||||
|
|
||||||
query = "CREATE TEXT SEARCH PARSER " + schema_name + "." + fts_parser_name + \
|
query = "CREATE TEXT SEARCH PARSER " + schema_name + "." + fts_parser_name + \
|
||||||
"(START=int4_accum, GETTOKEN=gist_box_penalty, " \
|
"(START=int4_accum, GETTOKEN=gist_box_penalty, " \
|
||||||
"END=btfloat4sortsupport, LEXTYPES=dsynonym_init)"
|
"END=btfloat4sortsupport, LEXTYPES=dsynonym_init)"
|
||||||
|
|
|
@ -27,6 +27,9 @@ def create_fts_template(server, db_name, schema_name, fts_temp_name):
|
||||||
server['port'])
|
server['port'])
|
||||||
pg_cursor = connection.cursor()
|
pg_cursor = connection.cursor()
|
||||||
|
|
||||||
|
query = "DROP TEXT SEARCH TEMPLATE IF EXISTS " + schema_name + "." + fts_temp_name
|
||||||
|
pg_cursor.execute(query)
|
||||||
|
|
||||||
query = "CREATE TEXT SEARCH TEMPLATE " + schema_name + "." + fts_temp_name + \
|
query = "CREATE TEXT SEARCH TEMPLATE " + schema_name + "." + fts_temp_name + \
|
||||||
"(INIT=dispell_init, LEXIZE=dispell_lexize)"
|
"(INIT=dispell_init, LEXIZE=dispell_lexize)"
|
||||||
pg_cursor.execute(query)
|
pg_cursor.execute(query)
|
||||||
|
|
Loading…
Reference in New Issue