Add control fulltext search

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-06-07 12:02:16 -07:00
parent 032144e04b
commit 67cc9d9ddc
9 changed files with 296 additions and 46 deletions

View File

@@ -0,0 +1,10 @@
ALTER TABLE controls ADD COLUMN search_vector tsvector
GENERATED ALWAYS AS (
to_tsvector('simple',
COALESCE(section_title, '') || ' ' ||
COALESCE(name, '') || ' ' ||
COALESCE(description, '')
)
) STORED;
CREATE INDEX controls_search_idx ON controls USING gin(search_vector);