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

[Feat] User 검색 API 구현 #175

Merged
merged 1 commit into from
Nov 28, 2024
Merged

[Feat] User 검색 API 구현 #175

merged 1 commit into from
Nov 28, 2024

Conversation

yangchef1
Copy link
Collaborator

관련 이슈 번호

close #174

작업 내용

  • User 검색 API 구현

고민과 학습내용

  • 이후 성능 문제가 생기면, username 필드에 index 설정해주는 방식으로 성능 개선을 해볼 수 있을 것 같습니다.

@yangchef1 yangchef1 added Feature 새로운 기능을 추가 BE 서버 작업 labels Nov 27, 2024
@yangchef1 yangchef1 self-assigned this Nov 27, 2024
Copy link
Collaborator

@PMtHk PMtHk left a comment

Choose a reason for hiding this comment

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

많은 데이터 넣어보고 성능 개선도 해보면 재밌겠군요

async searchUsers(query: string) {
return this.userRepository.find({
where: {
username: Like(`${query}%`),
Copy link
Collaborator

Choose a reason for hiding this comment

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

🟡
PMtHk 인데, Hk 로 검색하면 동작하지 않을 것 같습니다.
의도하신 부분일까요?

Copy link
Collaborator Author

@yangchef1 yangchef1 Nov 28, 2024

Choose a reason for hiding this comment

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

넵 무조건 앞 부분 기준으로만 검색되게 했습니다 !
Like %{query}% 는 인덱스 적용이 잘 안되는 것으로 알고 있어서, 사용자 경험을 크게 저해하지 않는다면 이렇게 구현해도 괜찮다고 생각했습니다.

@yangchef1 yangchef1 merged commit 006c8e6 into dev Nov 28, 2024
1 check passed
@jjeonghak jjeonghak deleted the feat/#174 branch December 3, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BE 서버 작업 Feature 새로운 기능을 추가
Projects
None yet
4 participants