Skip to content

Commit

Permalink
[BE] elasticsearch 검색 로직 수정 (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
leesungbin authored Dec 13, 2022
1 parent 6febd6b commit d9670e7
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions backend/src/search/search.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
],
Expand Down

0 comments on commit d9670e7

Please sign in to comment.