[REFACTOR] 파트너 검색 API 필터링 제거 및 개선#57
Conversation
industry / country / partnership / size 쿼리 파라미터를 API에서 제거. 국가 감지는 서비스 레이어에서 쿼리 텍스트를 분석해 자동으로 처리하는 방식으로 전환. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- COUNTRY_QUERY_MAP + detectCountryFromQuery: 쿼리 텍스트에서 국가명(한/영) 자동 감지 - 명시적 industry/country/partnership/size 필터 및 INDUSTRY_MAPPING 제거 - filter-only browsing(1.8) 제거, 쿼리 없을 때 전체 조회로 단일화 - RRF 중복 이름 제거 (seenNames) - 벡터 후보 수 확대: numCandidates 100→500, limit 100→200 - 웹 폴백 임계값 조정: dbResults.length === 0 → < 3 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
프로젝트 소개, 핵심 가치, 기술 스택, 아키텍처 다이어그램, API 엔드포인트, 비즈니스 모델 섹션 추가. 빠른 시작 가이드 구체화. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough파트너 검색 API 엔드포인트에서 industry/country/partnership/size 필터 파라미터를 제거하고, 쿼리 텍스트에서 국가를 자동으로 감지하는 메커니즘을 도입했습니다. RRF 병합 후 회사명 중복을 제거하고 웹 폴백 임계값을 조정했으며, 모든 테스트를 업데이트했습니다. Changes파트너 검색 API 필터 간소화 및 국가 자동 감지
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/modules/partners/partners.service.ts (1)
296-298: ⚡ Quick win벡터 검색 에러 로깅에서 원인 정보가 유실될 수 있습니다.
JSON.stringify(err)는 Error 객체에서{}가 나오는 경우가 많아 장애 분석이 어려워집니다.message기반 로그로 바꾸는 편이 안전합니다.🔧 제안 수정안
- this.logger.error( - `[Search] Vector search error: ${JSON.stringify(err)}`, - ); + this.logger.error( + `[Search] Vector search error: ${err?.message ?? String(err)}`, + );🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/modules/partners/partners.service.ts` around lines 296 - 298, The current vector-search error log uses JSON.stringify(err) which often yields "{}" for Error objects; update the logging in the vector search error path (the this.logger.error call inside the vector search handling in partners.service.ts) to log meaningful error details such as err.message and err.stack (or fallback to String(err)) instead of JSON.stringify(err) so callers get the actual cause and stack trace for debugging.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/modules/partners/partners.service.ts`:
- Around line 1009-1014: The detectCountryFromQuery function currently uses
substring includes on qLower against entries in COUNTRY_QUERY_MAP which causes
false positives (e.g., "truck" matching "uk"); update the matching to use
whole-word/phrase matching instead of includes: normalize qLower and each kr/en
to lowercase, and for each entry test either tokenized word membership (split
qLower on non-alphanumeric boundaries and compare exact tokens) or construct a
word-boundary-aware regex for the kr and en values (using \b ... \b) so
multi-word phrases still match correctly; change the loop in
detectCountryFromQuery to use this exact-token or \b-regex test against kr and
en rather than simple includes.
- Around line 348-353: The filter that deduplicates partners uses only (r.name
|| r.name_kr) to build the key, so records that have only an English-only field
(nameEn or name_en) are treated as empty and dropped; update the deduplication
key logic inside the .filter callback (the function that computes key and uses
seenNames) to include the English name field(s) as fallbacks (e.g., r.nameEn or
r.name_en) and consistently normalize/trim the selected value before checking
seenNames so English-only partners are preserved and de-duplicated correctly.
---
Nitpick comments:
In `@src/modules/partners/partners.service.ts`:
- Around line 296-298: The current vector-search error log uses
JSON.stringify(err) which often yields "{}" for Error objects; update the
logging in the vector search error path (the this.logger.error call inside the
vector search handling in partners.service.ts) to log meaningful error details
such as err.message and err.stack (or fallback to String(err)) instead of
JSON.stringify(err) so callers get the actual cause and stack trace for
debugging.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5a4bd3e6-e120-4277-835c-3168e94bfe5a
📒 Files selected for processing (5)
README.mdsrc/modules/partners/partners.controller.spec.tssrc/modules/partners/partners.controller.tssrc/modules/partners/partners.service.spec.tssrc/modules/partners/partners.service.ts
💤 Files with no reviewable changes (2)
- README.md
- src/modules/partners/partners.controller.ts
Resolves #56
변경 요약
파트너 검색에서 드롭다운 기반 필터를 제거하고,
쿼리 텍스트 분석으로 국가를 자동 감지하는 방식으로 전환.
주요 변경
GET /partners/search— industry/country/partnership/size 파라미터 제거Summary by CodeRabbit
릴리스 노트
Bug Fixes
개선 사항
Documentation