+ temp_db_cursor.execute("DROP TYPE IF EXISTS prepare_update_info CASCADE")
+ temp_db_cursor.execute("""CREATE TYPE prepare_update_info AS (
+ name HSTORE,
+ address HSTORE,
+ rank_address SMALLINT,
+ country_code TEXT,
+ class TEXT,
+ type TEXT,
+ linked_place_id BIGINT
+ )""")
+ temp_db_cursor.execute("""CREATE OR REPLACE FUNCTION placex_indexing_prepare(p placex,
+ OUT result prepare_update_info)
+ AS $$
+ BEGIN
+ result.address := p.address;
+ result.name := p.name;
+ result.class := p.class;
+ result.type := p.type;
+ result.country_code := p.country_code;
+ result.rank_address := p.rank_address;
+ END;
+ $$ LANGUAGE plpgsql STABLE;
+ """)
+ factory.create_tokenizer(project_env)