[검색 TF] 검색 기능 개편#54
Merged
Merged
Conversation
jwchoi-kr
reviewed
May 16, 2026
|
|
||
| const INVALID_FILTER_MESSAGE = 'invalid search filter' | ||
|
|
||
| const MIN_ACTIVITY_PERIOD_FILTERS = new Set<MinActivityPeriodFilter>(['0', '1', '2', '2_plus']) |
Collaborator
There was a problem hiding this comment.
지금 보니까 2랑 2_plus가 같이 있는게 약간 이상한거 같기도 하네요
0 1 2_plus
또는
0 1 2 3_plus가 자연스럽지 않나요
Collaborator
There was a problem hiding this comment.
아 그러네요 3학기 이상으로 피그마/프론트도 수정해야할 것 같아요
Collaborator
Author
There was a problem hiding this comment.
맞춰서 서버도 수정해둘게요!
Collaborator
There was a problem hiding this comment.
헐 이거 바빠서 이제 확인했는데 app에도 반영하겠습니다
3 tasks
SearchService를 orchestrator로 축소하고 검색 흐름을 component 단위로 분리한다. - server/service/search/ 아래로 search-query, search-typo-correction, search-result-hydrator, search-sort, search-log component와 search.types를 추가 - 직접 검색을 name, shortDescription, college_major 기반으로 통합하고 fullName, tags 매칭은 제거 - 오타 보정 후보 source를 name과 tokenized shortDescription으로 좁힘 - 기본 정렬을 isOfficialVerified 우선 + 그룹 내부 random으로 변경 - club.uuid 기준 dedupe와 review hydration 유지, API 응답 계약 유지
GET /api/v2/clubs/search에 facet 필터 query를 추가한다. 원 검색어와 오타 보정어 검색 모두에 동일하게 적용된다. - SearchFilterService 신설, club 컬럼 기반 필터(affiliation_type, recruit_type, has_dongbang, is_official_verified, min_activity_period)와 최신 유효 recruitment LATERAL JOIN 기반 필터(is_recruiting, has_membership_fee) 적용 - SearchQueryService를 QueryBuilder 기반으로 전환하여 텍스트 검색과 college_major 검색 모두 동일 필터를 거치도록 변경 - min_activity_period는 0, 1, 2, 2_plus 다중 선택을 지원하며 2_plus는 club.min_activity_period >= 2로 해석 - API handler에 parseSearchFilters 추가, boolean/enum/min_activity_period 잘못된 값은 400 invalid search filter 반환 - ClubSearchQuerySchema와 OpenAPI 문서를 확장 - sql/260510.sql에 club 필터 컬럼과 club_recruitment 인덱스 추가 (DB 수동 적용 필요)
9b9cc7d to
e4370b8
Compare
* feat: add user recent searches 사용자별 최근 검색어 저장/조회/전체삭제 API를 v2에 추가한다. 오타 보정이 동작해도 저장 값은 무조건 원본 검색어이며, 검색 API와 별도 endpoint로 분리해 응답 계약을 건드리지 않는다. - user_recent_search 테이블과 UserRecentSearchEntity 신설, datasource entities 배열에 등록 (sql/260514.sql 수동 적용 필요) - UserService에 findRecentSearches / saveRecentSearch / deleteRecentSearches 추가. 저장은 delete-after-insert + FIFO eviction을 트랜잭션으로 처리해 사용자별 최대 8개를 유지한다 - GET / POST / DELETE /api/v2/users/me/recent-searches handler 추가. POST는 trim 후 빈 문자열이면 zod로 400을 반환한다 - CreateRecentSearchSchema, RecentSearchSchema, RecentSearchesResponseSchema 및 OpenAPI path 등록 * perf: collapse recent search save into upsert + single cleanup 같은 검색어 재저장과 8개 초과 정리 로직을 INSERT ON CONFLICT DO UPDATE와 NOT IN 단일 DELETE로 대체해 저장 경로의 DB 라운드트립을 4회에서 2회로 줄인다. 정렬 키도 created_at에서 updated_at으로 통일해 재검색 시 자연스럽게 최상단으로 올라오게 한다. - saveRecentSearch에서 트랜잭션 + delete + insert + find + delete 흐름을 raw upsert + raw cleanup DELETE 2회로 교체. evictOldRecentSearches 헬퍼 제거 - findRecentSearches 정렬을 updatedAt DESC로 변경 - 인덱스를 ix_user_recent_search_service_user_updated_at (service_user_id, updated_at DESC)로 교체 - API 응답 createdAt 필드는 그대로 두고 내부 매핑만 it.updatedAt로 변경 * fix: align recent search API contract * chore: add redis client configuration * feat: autosave recent searches from search * test: add recent search test APIs and swagger docs * refactor: simplify recent search internals * refactor: simplify recent search debug response
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[1차 commit]
SearchService를 orchestrator로 축소하고 검색 흐름을 component 단위로 분리한다.
component의 위치는
/server/service/search아래search-query,search-typo-correction,search-result-hydrator,search-sort,search-log component와search.types를 추가name, shortDescription+college_major기반으로 통합하고fullName, tags매칭은 제거 (v2)[2차 commit]
Filter 로직을 추가
원 검색어와 오타 보정어 검색 모두에 동일하게 적용
SearchFilterService 컴포넌트 신규 생성
affiliation_type,recruit_type,has_dongbang,is_official_verified,min_activity_period)is_recruiting,has_membership_fee)club.min_activity_period >= 2로 해석