Schema changes for owner searching to include ownr_co_nm. Requires index rebuild BOD-44

This commit is contained in:
Patrick Fic
2020-04-27 09:31:01 -07:00
parent 17787da0b4
commit d359589b96
6 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,18 @@
- args:
cascade: true
read_only: false
sql: |-
CREATE OR REPLACE FUNCTION public.search_owner(search text)
RETURNS SETOF owners
LANGUAGE sql
STABLE
AS $function$
SELECT *
FROM owners
WHERE
search <% (ownr_fn || ' ' || ownr_ln || ' ' || ownr_co_nm)
ORDER BY
similarity(search, (ownr_fn || ' ' || ownr_ln || ' ' || ownr_co_nm)) DESC
LIMIT 5;
$function$;
type: run_sql

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,5 @@
- args:
cascade: true
read_only: false
sql: drop index idx_owner_name;
type: run_sql

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,7 @@
- args:
cascade: true
read_only: false
sql: |-
CREATE INDEX idx_owner_name ON owners USING GIN ((ownr_fn || ' ' || ownr_ln || ' ' || ownr_co_nm)
gin_trgm_ops);
type: run_sql