From d9670e7c2e1f184bf7ec9623325fc76888f563d9 Mon Sep 17 00:00:00 2001 From: leesungbin Date: Tue, 13 Dec 2022 15:37:57 +0900 Subject: [PATCH] =?UTF-8?q?[BE]=20elasticsearch=20=EA=B2=80=EC=83=89=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95=20(#132)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/search/search.service.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/backend/src/search/search.service.ts b/backend/src/search/search.service.ts index 2d22a7c..007c227 100644 --- a/backend/src/search/search.service.ts +++ b/backend/src/search/search.service.ts @@ -101,21 +101,18 @@ export class SearchService { }); } async getElasticSearch(keyword: string, size = 5, from = 0) { + const key = decodeURIComponent(keyword); const query = { bool: { should: [ { - match_bool_prefix: { - title: { - query: keyword, - }, + match_phrase_prefix: { + title: key, }, }, { - match_bool_prefix: { - author: { - query: keyword, - }, + match_phrase_prefix: { + authors: key, }, }, ],