From 308d0a62a6e6c9f586915d055b90880534682dbc Mon Sep 17 00:00:00 2001 From: PrivateGER Date: Fri, 26 May 2023 02:38:18 +0200 Subject: [PATCH] Correct logging statement + add missing returns --- packages/backend/src/db/meilisearch.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/db/meilisearch.ts b/packages/backend/src/db/meilisearch.ts index edd077c03f..25cdc13d4b 100644 --- a/packages/backend/src/db/meilisearch.ts +++ b/packages/backend/src/db/meilisearch.ts @@ -78,18 +78,20 @@ export default hasConfig ? { let date = Date.parse(timestamp); if (isNaN(date)) return false; constructedFilters.push(`createdAt > ${date}`) + return false; } else if (term.startsWith("before:")) { let timestamp = term.slice(7); // Try to parse the timestamp as JavaScript Date let date = Date.parse(timestamp); if (isNaN(date)) return false; constructedFilters.push(`createdAt < ${date}`) + return false; } return true; }) - logger.info(`Searching for ${query}`); + logger.info(`Searching for ${splitSearch.join(" ")}`); logger.info(`Limit: ${limit}`); logger.info(`Offset: ${offset}`); logger.info(`Filters: ${constructedFilters}`)