From 5b672e20af1c0013fdeab08960a07a9f2b0b39f9 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sat, 18 Nov 2023 04:08:48 +0100 Subject: [PATCH] [backend] Postgres FTS query should be trimmed --- packages/backend/src/server/api/common/generate-fts-query.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/common/generate-fts-query.ts b/packages/backend/src/server/api/common/generate-fts-query.ts index 3817f4050..eaa3e5f8c 100644 --- a/packages/backend/src/server/api/common/generate-fts-query.ts +++ b/packages/backend/src/server/api/common/generate-fts-query.ts @@ -29,7 +29,7 @@ const filters = { //TODO: new filters are missing from the filter dropdown, and said dropdown should always show (remove the searchFilters meta prop), also we should fix the null bug export function generateFtsQuery(query: SelectQueryBuilder, q: string): void { - const components = q.split(" "); + const components = q.trim().split(" "); const terms: string[] = []; let finalTerms: string[] = []; let counter = 0;