Refactor phases 5 - search - tests
parent
c8659bd45d
commit
40890101b1
@ -1,26 +1,26 @@
|
||||
-- Slice 1 generic lexical search support.
|
||||
-- Adds PostgreSQL full-text and trigram search infrastructure for DOC-side search.
|
||||
|
||||
CREATE EXTENSION IF NOT EXISTS pg_trgm;
|
||||
CREATE EXTENSION IF NOT EXISTS pg_trgm with schema doc;
|
||||
|
||||
ALTER TABLE DOC.doc_text_representation
|
||||
ALTER TABLE doc.doc_text_representation
|
||||
ADD COLUMN IF NOT EXISTS search_config VARCHAR(64);
|
||||
|
||||
ALTER TABLE DOC.doc_text_representation
|
||||
ALTER TABLE doc.doc_text_representation
|
||||
ADD COLUMN IF NOT EXISTS search_vector tsvector;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_doc_text_repr_search_vector
|
||||
ON DOC.doc_text_representation
|
||||
ON doc.doc_text_representation
|
||||
USING GIN (search_vector);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_doc_document_title_trgm
|
||||
ON DOC.doc_document
|
||||
USING GIN (title gin_trgm_ops);
|
||||
ON doc.doc_document
|
||||
USING GIN (title doc.gin_trgm_ops);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_doc_document_summary_trgm
|
||||
ON DOC.doc_document
|
||||
USING GIN (summary gin_trgm_ops);
|
||||
ON doc.doc_document
|
||||
USING GIN (summary doc.gin_trgm_ops);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_doc_text_repr_text_trgm
|
||||
ON DOC.doc_text_representation
|
||||
USING GIN (text_body gin_trgm_ops);
|
||||
ON doc.doc_text_representation
|
||||
USING GIN (text_body doc.gin_trgm_ops);
|
||||
|
||||
Loading…
Reference in New Issue