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, }, }, ],