From 3aa314707ab0a12af3a327ca0a2989fe6d5ab371 Mon Sep 17 00:00:00 2001 From: Sambit Sankalp <82284130+sambit-sankalp@users.noreply.github.com> Date: Sat, 14 May 2022 19:49:01 +0530 Subject: [PATCH] fix: search query index fix (#133) --- server/schema/article/article.datasources.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/schema/article/article.datasources.js b/server/schema/article/article.datasources.js index 17ab1750..5f25b460 100644 --- a/server/schema/article/article.datasources.js +++ b/server/schema/article/article.datasources.js @@ -16,7 +16,7 @@ const ARTICLE_PUBLISH_TYPES = Object.fromEntries( const getBaseConditions = (allowRestricted, onlyPublished) => { const _baseConditions = []; if (!allowRestricted) { - _baseConditions.push({ isInstituteRestrcited: false }); + _baseConditions.push({ isInstituteRestricted: false }); } if (onlyPublished) { _baseConditions.push({ publishStatus: ARTICLE_PUBLISH_TYPES.PUBLISHED }); @@ -99,7 +99,7 @@ const search = (keywords, allowRestricted, onlyPublished, limit, offset) => ArticleModel.aggregate([ { $search: { - index: 'default', + index: 'articleSearch', text: { query: keywords, path: ['title', 'inshort', 'tags.name'],