Skip to content

[NOOK-171] 장소 매칭 지역 보강 - #114

Open
dh1010a wants to merge 4 commits into
mainfrom
codex/NOOK-171
Open

[NOOK-171] 장소 매칭 지역 보강#114
dh1010a wants to merge 4 commits into
mainfrom
codex/NOOK-171

Conversation

@dh1010a

@dh1010a dh1010a commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

What Changed

  • Google Places 보강 검색을 다중 쿼리 기반으로 확장했습니다.
  • 사진이 없는 후보보다 사진이 있는 후보를 우선 선택하도록 보강했습니다.
  • 먼 지역의 동일명 장소가 잘못 매칭되는 경우를 거리와 지역 기준으로 감점하도록 조정했습니다.
  • Kakao/Naver 후보 정렬에도 지역 토큰 기반 점수와 지역 검증을 추가했습니다.
  • 관련 매칭/검증 시나리오 테스트를 보강했습니다.

Why

  • 모로코코, 보니스피자 용산점 같은 케이스에서 이름만으로는 약하지만 카테고리/지역 힌트를 주면 더 정확한 Google 후보가 나오는 문제가 있었습니다.
  • Kakao/Naver 후보 선택에서도 다른 지역의 동일명 플레이스가 상위에 오는 오매칭 위험이 있었습니다.

Impact

  • 장소 사진 누락 비율이 줄어들고, 다른 지역 플레이스 오매칭이 줄어들 것으로 기대됩니다.
  • 기존 API 계약은 변경하지 않았고, 내부 후보 선택 규칙과 검증 로직만 보강했습니다.

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

@dh1010a dh1010a closed this Aug 13, 2026
@dh1010a dh1010a reopened this Aug 13, 2026
@dh1010a
dh1010a marked this pull request as ready for review August 13, 2026 10:27
@dh1010a
dh1010a requested a review from kkjsw17 as a code owner August 13, 2026 10:27

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +96 to +98
compareBy<RankedGooglePlace> { it.photoCount > 0 }
.thenBy { it.score }
.thenBy { it.photoCount },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment on lines +82 to +83
val textCandidates = queries.flatMap { query ->
searchText(query, place).map { candidate ->

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +59 to +60
val regionsAlign = regionScore(queryContext, candidate.address) > 0 &&
regionScore(queryContext, naver.address) > 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant