BEGIN;
+-- INSERT-only table that catches updates to be reconciled
+CREATE UNLOGGED TABLE search.symspell_dictionary_updates (
+ transaction_id BIGINT,
+ keyword_count INT NOT NULL DEFAULT 0,
+ title_count INT NOT NULL DEFAULT 0,
+ author_count INT NOT NULL DEFAULT 0,
+ subject_count INT NOT NULL DEFAULT 0,
+ series_count INT NOT NULL DEFAULT 0,
+ identifier_count INT NOT NULL DEFAULT 0,
+
+ prefix_key TEXT NOT NULL,
+
+ keyword_suggestions TEXT[],
+ title_suggestions TEXT[],
+ author_suggestions TEXT[],
+ subject_suggestions TEXT[],
+ series_suggestions TEXT[],
+ identifier_suggestions TEXT[]
+);
+CREATE INDEX symspell_dictionary_updates_tid_idx ON search.symspell_dictionary_updates (transaction_id);
+
CREATE OR REPLACE FUNCTION search.disable_symspell_reification () RETURNS VOID AS $f$
INSERT INTO config.internal_flag (name,enabled)
VALUES ('ingest.disable_symspell_reification',TRUE)