[NOOK-171] 장소 매칭 지역 보강 - #114
Conversation
68bb94a to
e42be1f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e42be1f715
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| compareBy<RankedGooglePlace> { it.photoCount > 0 } | ||
| .thenBy { it.score } | ||
| .thenBy { it.photoCount }, |
There was a problem hiding this comment.
Rank match quality before photo availability
Make the match score the primary ordering key rather than photoCount > 0. As written, any candidate above the low 45-point threshold with one photo beats an exact-name, exact-address, nearby candidate without photos, even if its score is much lower. That can persist the wrong Google Place ID and unrelated photos for same-city places with similar names; the photo bonus already included in matchScore can break ties without overriding substantially stronger identity evidence.
Useful? React with 👍 / 👎.
| val textCandidates = queries.flatMap { query -> | ||
| searchText(query, place).map { candidate -> |
There was a problem hiding this comment.
Preserve successful candidates when a later query fails
Isolate failures for each supplemental text query. flatMap executes every generated query inside the single outer fetch runCatching, so if the first query returns the correct place but any later category, city, address-token, or name-only request gets a transient 5xx, the exception discards all previously collected candidates and fetch returns null. The multi-query fallback therefore makes success depend on every Google request succeeding instead of retaining any usable response.
Useful? React with 👍 / 👎.
| val regionsAlign = regionScore(queryContext, candidate.address) > 0 && | ||
| regionScore(queryContext, naver.address) > 0 |
There was a problem hiding this comment.
Allow Naver validation when no region token is present
Treat an empty regionTokens set as having no additional region constraint. Currently regionScore(...) > 0 is always false for ordinary queries such as a bare place name or 보니스피자 용산점, because no token ends with one of the configured suffixes; consequently Naver can never validate or reorder Kakao candidates even when their names and addresses agree. If multiple same-name Kakao results have equal base scores, the possibly wrong upstream-first result remains first despite Naver identifying the matching address.
Useful? React with 👍 / 👎.
e42be1f to
56c6dee
Compare
What Changed
Why
모로코코,보니스피자 용산점같은 케이스에서 이름만으로는 약하지만 카테고리/지역 힌트를 주면 더 정확한 Google 후보가 나오는 문제가 있었습니다.Impact
Validation
./gradlew :nook-api-infrastructure:detekt./gradlew :nook-api-infrastructure:test --tests org.every.nook.api.infrastructure.place.PrioritizedPlaceSearchProviderTest --tests org.every.nook.api.infrastructure.place.GooglePlacePhotoProviderTest