diff --git a/client/src/components/global-search/global-search.component.jsx b/client/src/components/global-search/global-search.component.jsx
index 6d2d138b0..4135f8dc7 100644
--- a/client/src/components/global-search/global-search.component.jsx
+++ b/client/src/components/global-search/global-search.component.jsx
@@ -62,7 +62,7 @@ export default function GlobalSearch() {
}`,
label: (
- }>
+ } wrap>
{`${owner.ownr_fn || ""} ${owner.ownr_ln || ""} ${
owner.ownr_co_nm || ""
}`}
diff --git a/hasura/migrations/1633647205750_run_sql_migration/down.sql b/hasura/migrations/1633647205750_run_sql_migration/down.sql
new file mode 100644
index 000000000..36ca692a7
--- /dev/null
+++ b/hasura/migrations/1633647205750_run_sql_migration/down.sql
@@ -0,0 +1,51 @@
+-- Could not auto-generate a down migration.
+-- Please write an appropriate down migration for the SQL below:
+-- CREATE
+-- OR REPLACE FUNCTION public.search_owners (search text) RETURNS SETOF owners LANGUAGE plpgsql STABLE AS $function$
+-- BEGIN
+-- IF search = ''
+-- THEN
+-- RETURN query
+-- SELECT
+-- *
+-- FROM
+-- owners;
+-- ELSE
+-- RETURN query
+-- SELECT
+-- *
+-- FROM
+-- owners
+-- WHERE
+-- (
+-- ownr_fn || ' ' || ownr_ln
+-- )
+-- ILIKE '%' || search || '%'
+-- OR ownr_ln ILIKE '%' || search || '%'
+-- OR ownr_fn ILIKE '%' || search || '%'
+-- OR ownr_fn ILIKE '%' || search || '%'
+-- OR ownr_co_nm ILIKE '%' || search || '%'
+-- OR ownr_ph1 ILIKE '%' || search || '%'
+-- OR ownr_ph2 ILIKE '%' || search || '%'
+-- OR ownr_addr1 ILIKE '%' || search || '%'
+-- ORDER BY
+-- (ownr_fn || ' ' || ownr_ln) ILIKE '%' || search || '%'
+-- OR NULL,
+-- ownr_ln ILIKE '%' || search || '%'
+-- OR NULL,
+-- ownr_fn ILIKE '%' || search || '%'
+-- OR NULL,
+-- ownr_co_nm ILIKE '%' || search || '%'
+-- OR NULL,
+-- ownr_fn ILIKE '%' || search || '%'
+-- OR NULL,
+-- ownr_ph1 ILIKE '%' || search || '%'
+-- OR NULL,
+-- ownr_ph2 ILIKE '%' || search || '%'
+-- OR NULL,
+-- ownr_addr1 ILIKE '%' || search || '%'
+-- OR NULL;
+-- END
+-- IF;
+-- END
+-- $function$;
diff --git a/hasura/migrations/1633647205750_run_sql_migration/up.sql b/hasura/migrations/1633647205750_run_sql_migration/up.sql
new file mode 100644
index 000000000..8891a1471
--- /dev/null
+++ b/hasura/migrations/1633647205750_run_sql_migration/up.sql
@@ -0,0 +1,49 @@
+CREATE
+OR REPLACE FUNCTION public.search_owners (search text) RETURNS SETOF owners LANGUAGE plpgsql STABLE AS $function$
+BEGIN
+ IF search = ''
+THEN
+ RETURN query
+ SELECT
+ *
+ FROM
+ owners;
+ELSE
+ RETURN query
+ SELECT
+ *
+ FROM
+ owners
+ WHERE
+ (
+ ownr_fn || ' ' || ownr_ln
+ )
+ ILIKE '%' || search || '%'
+ OR ownr_ln ILIKE '%' || search || '%'
+ OR ownr_fn ILIKE '%' || search || '%'
+ OR ownr_fn ILIKE '%' || search || '%'
+ OR ownr_co_nm ILIKE '%' || search || '%'
+ OR ownr_ph1 ILIKE '%' || search || '%'
+ OR ownr_ph2 ILIKE '%' || search || '%'
+ OR ownr_addr1 ILIKE '%' || search || '%'
+ ORDER BY
+(ownr_fn || ' ' || ownr_ln) ILIKE '%' || search || '%'
+ OR NULL,
+ ownr_ln ILIKE '%' || search || '%'
+ OR NULL,
+ ownr_fn ILIKE '%' || search || '%'
+ OR NULL,
+ ownr_co_nm ILIKE '%' || search || '%'
+ OR NULL,
+ ownr_fn ILIKE '%' || search || '%'
+ OR NULL,
+ ownr_ph1 ILIKE '%' || search || '%'
+ OR NULL,
+ ownr_ph2 ILIKE '%' || search || '%'
+ OR NULL,
+ ownr_addr1 ILIKE '%' || search || '%'
+ OR NULL;
+END
+IF;
+END
+$function$;