Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] feat#329 퀴즈검색 성능개선 #330

Merged
merged 5 commits into from
Dec 23, 2024

Conversation

DongHoonYu96
Copy link
Collaborator

@DongHoonYu96 DongHoonYu96 commented Dec 19, 2024

➕ 이슈 번호


🔎 작업 내용

이 PR은 백엔드 서비스의 여러 변경사항을 포함하며, 데이터베이스 초기화, 퀴즈셋 데이터 관리, 검색 기능 개선에 중점을 두었습니다. 가장 중요한 변경사항은 다음과 같습니다:

퀴즈셋 카테고리 제한:

  • initDB api가 카테고리 제한때문에 오류를 뱉는 문제.
  • QUIZ_SET_TEST_DATA.ts: "영어 문법 테스트" 퀴즈셋의 카테고리를 'ENGLISH'에서 'LANGUAGE'로 변경했습니다.

전문 검색(Full-Text Search) 개선:

  • quiz-choice.entity.ts: choiceContent 컬럼에 ngram 파서를 사용하는 전문 검색 인덱스를 추가했습니다.
  • quiz-set.entity.ts: title 컬럼에 ngram 파서를 사용하는 전문 검색 인덱스를 추가했습니다.
  • quiz.entity.ts: quiz 컬럼에 ngram 파서를 사용하는 전문 검색 인덱스를 추가했습니다.

성능 로깅:

  • quiz-set.controller.ts: 퀴즈셋 목록을 가져오는데 걸리는 시간을 측정하기 위한 성능 로깅을 추가했습니다.

코드베이스 단순화:

  • quiz-set-read.service.ts: findSearchTargetIds 메서드를 전문 검색을 위한 findSearchTargetIdsFS를 사용하도록 리팩토링하고, 새로운 메서드에 대한 자세한 문서화와 성능 지표를 추가했습니다.

🖼 참고 이미지

image


🎯 리뷰 요구사항 (선택)

  • 특별히 봐줬으면 하는 부분이 있다면 적어주세요

✅ Check List

  • merge할 브랜치의 위치를 확인했나요?
  • Label을 지정했나요?

@Copilot Copilot bot review requested due to automatic review settings December 19, 2024 16:17
@DongHoonYu96 DongHoonYu96 self-assigned this Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 8 changed files in this pull request and generated no comments.

Files not reviewed (3)
  • BE/src/InitDB/QUIZ_SET_TEST_DATA.ts: Evaluated as low risk
  • BE/src/main.ts: Evaluated as low risk
  • BE/src/quiz-set/entities/quiz-choice.entity.ts: Evaluated as low risk
Comments suppressed due to low confidence (2)

BE/src/quiz-set/service/quiz-set-read.service.ts:118

  • The construction of searchQuery does not handle special characters in the search term, which could lead to incorrect query results or errors.
const searchQuery = `+"${search.split(' ').join('" +"')}`;

BE/src/quiz-set/service/quiz-set-read.service.ts:151

  • [nitpick] The type casting of choiceResults to any is unclear and should be replaced with a more explicit type definition for better readability and maintainability.
...choiceResults.map((c) => (c as any).quizSetId)
Copy link
Collaborator

@ijun17 ijun17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DongHoonYu96 DongHoonYu96 merged commit b39179d into boostcampwm-2024:dev-be Dec 23, 2024
4 of 5 checks passed
@DongHoonYu96 DongHoonYu96 deleted the feature-be-#329 branch December 23, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants