Skip to content

feat: id 컬럼 부분 검색을 위한 idLike 필터 추가#46

Merged
Jongyeol91 merged 3 commits intomainfrom
feat/add-id-like-search
Feb 27, 2025
Merged

feat: id 컬럼 부분 검색을 위한 idLike 필터 추가#46
Jongyeol91 merged 3 commits intomainfrom
feat/add-id-like-search

Conversation

@Jongyeol91
Copy link
Copy Markdown
Contributor

@Jongyeol91 Jongyeol91 commented Feb 27, 2025

PR 의 종류는 어떤 것인가요?

  • 새로운 기능

수정이 필요하게된 이유가 무엇인가요? (Jira 이슈가 있다면 링크를 연결해주세요)

무엇을 어떻게 변경했나요?

table의 id를 string으로 형변환하여 like 검색을 할 수 있는 기능을 추가했습니다.
id index를 타기 위해 between 검색으로 변경
#46 (comment)

  • ex) 백오피스 상품검색 input에서 아이디를 타이핑할때 실시간으로 관련 아이디 리스팅될 수 있게됨

코드 변경을 이해하기 위한 배경지식이 필요하다면 설명 해주세요.

사용되는 index

  • PRIMARY,product_site_index

디펜던시 변경이 있나요?

https://github.com/day1co/redstone/pull/2617

어떻게 테스트 하셨나요?

코드의 실행결과를 볼 수 있는 로그나 이미지가 있다면 첨부해주세요.

@Jongyeol91 Jongyeol91 self-assigned this Feb 27, 2025
@day1-dev-adm day1-dev-adm added the enhancement New feature or request label Feb 27, 2025
}
}
}
if (idLike) {
Copy link
Copy Markdown
Contributor

@soomtong soomtong Feb 27, 2025

Choose a reason for hiding this comment

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

임시 방편이긴 하지만 title 검색과 함께 매우 유용한 상황이어서 이해해주세요. @9w @TaehuiKim

@Jongyeol91 Jongyeol91 force-pushed the feat/add-id-like-search branch 3 times, most recently from 4405fa6 to bd6ac6a Compare February 27, 2025 07:53
@Jongyeol91 Jongyeol91 force-pushed the feat/add-id-like-search branch from bd6ac6a to 5d603d3 Compare February 27, 2025 07:57
@Jongyeol91
Copy link
Copy Markdown
Contributor Author

Jongyeol91 commented Feb 27, 2025

@soomtong 영택님 형변환시에 index를 타지 못하여 id between 검색으로 변경하였습니다.
7db7fbf

idLike가 "12"인 경우
start = 12
end = 13 10000 - 1 = 129999
따라서 12부터 129999 사이의 모든 id를 검색

cc. @Q00

@TaehuiKim
Copy link
Copy Markdown
Contributor

TaehuiKim commented Feb 27, 2025

@Jongyeol91 이 PR 작성 자체에 반대하는 것은 아니구요, 질문 좀 드리고 싶어요...
혹시 한 자리만 입력했을 때 idLike가 "1"인 경우, 1 ~ 199999 모든 것을 검색하게 되는 것이 맞을까요?

@Jongyeol91
Copy link
Copy Markdown
Contributor Author

@Jongyeol91 이 PR 작성 자체에 반대하는 것은 아니구요, 질문 좀 드리고 싶어요... 혹시 한 자리만 입력했을 때 idLike가 "1"인 경우, 1 ~ 199999 모든 것을 검색하게 되는 것이 맞을까요?

@TaehuiKim 네 맞습니다 현재 프로덕트가 47만건 정도 있어서 우선 100만건 까지 가능하도록 6자리의 검색을 하게 만들어 두었습니다.

Copy link
Copy Markdown
Contributor

@TaehuiKim TaehuiKim left a comment

Choose a reason for hiding this comment

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

백오피스에서만 쓰실거라니까 일단은...
P3; 한 자리부터 검색 시키는건 between 범위가 너무 커지는 것 같아서, 최소한 두 자리부터 검색할 수 있도록 제한을 두면 좋을 것 같습니다...!
cc @Q00

@TaehuiKim
Copy link
Copy Markdown
Contributor

종열님께 별도로 설명 들었는데, EXPLAIN 했을 때 크게 차이가 없을 것이라는 의견 & 10개씩 잘라서 호출 할 것이라고 하셔서 수정 필요 없을 듯 합니다...!

@Jongyeol91 Jongyeol91 merged commit f5844de into main Feb 27, 2025
1 check passed
@Jongyeol91 Jongyeol91 deleted the feat/add-id-like-search branch February 27, 2025 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants