Fix: Move catalog search indexes to ETL migration

This commit is contained in:
Eric Gullickson
2025-12-18 13:53:50 -06:00
parent 7a2e11953a
commit cdb9d5575f
2 changed files with 7 additions and 14 deletions

View File

@@ -1,14 +0,0 @@
-- Migration: Add full-text search index for vehicle catalog search
-- Date: 2025-12-15
-- Add full-text search index on vehicle_options table
-- Combines year, make, model, and trim into a single searchable tsvector
-- Using || operator instead of concat() because || is IMMUTABLE
CREATE INDEX IF NOT EXISTS idx_vehicle_options_fts ON vehicle_options
USING gin(to_tsvector('english', year::text || ' ' || make || ' ' || model || ' ' || trim));
-- Add an index on engines.name for join performance during search
CREATE INDEX IF NOT EXISTS idx_engines_name ON engines(name);
-- Add comment for documentation
COMMENT ON INDEX idx_vehicle_options_fts IS 'Full-text search index for admin catalog search functionality';