[backend] Postgres FTS query should be trimmed

This commit is contained in:
Laura Hausmann 2023-11-18 04:08:48 +01:00
parent c72eb36d66
commit 5b672e20af
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -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 //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<any>, q: string): void { export function generateFtsQuery(query: SelectQueryBuilder<any>, q: string): void {
const components = q.split(" "); const components = q.trim().split(" ");
const terms: string[] = []; const terms: string[] = [];
let finalTerms: string[] = []; let finalTerms: string[] = [];
let counter = 0; let counter = 0;