From e6371e4665703aba1a3af684378c85103340e35e Mon Sep 17 00:00:00 2001 From: PrivateGER Date: Thu, 25 May 2023 22:37:43 +0200 Subject: [PATCH] Adjust search term logging + use filtered search query --- packages/backend/src/db/meilisearch.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/db/meilisearch.ts b/packages/backend/src/db/meilisearch.ts index 49b955672f..eecbf93e62 100644 --- a/packages/backend/src/db/meilisearch.ts +++ b/packages/backend/src/db/meilisearch.ts @@ -41,9 +41,6 @@ export type MeilisearchNote = { export default hasConfig ? { search: (query : string, limit : number, offset : number) => { - logger.info(`Searching for ${query}`); - logger.info(`Limit: ${limit}`); - logger.info(`Offset: ${offset}`); /// Advanced search syntax /// from:user => filter by user + optional domain @@ -88,7 +85,13 @@ export default hasConfig ? { return true; }) - return posts.search(query, { + logger.info(`Searching for ${query}`); + logger.info(`Limit: ${limit}`); + logger.info(`Offset: ${offset}`); + logger.info(`Filters: ${constructedFilters}`) + + + return posts.search(splitSearch.join(" "), { limit: limit, offset: offset, filter: constructedFilters