[Hotfix] 하이브리드 검색 후속 이슈 보완#37
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a search_tsvector column to the regulation_chunk table to support full-text search, updating the repository to populate this field during record creation and removing the previous post-creation refresh logic. Additionally, it optimizes the chat service by reusing query embeddings when the expanded query is identical to the retrieval query. A performance concern was identified in the database migration, where the batched backfill logic may cause sequential scans on each iteration; it is recommended to use ID-based range processing instead.
Comment on lines
+32
to
+38
| WITH target_chunks AS ( | ||
| SELECT regulation_chunk_id | ||
| FROM regulation_chunk | ||
| WHERE search_tsvector IS NULL | ||
| ORDER BY regulation_chunk_id | ||
| LIMIT :batch_size | ||
| ) |
Contributor
There was a problem hiding this comment.
e813dd9 to
6c2bf2e
Compare
6c2bf2e to
9dc4c0a
Compare
1024andrew
added a commit
that referenced
this pull request
May 7, 2026
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.
유형
작업 내용
하이브리드 검색 인덱스 개선 이후 리뷰에서 지적된 후속 이슈를 보완합니다.
search_tsvector생성 경로에서 불필요한 추가 UPDATE를 제거하고, 기존 데이터 backfill을 batch 단위로 나누어 처리하도록 수정했습니다. 또한 query expansion fallback에서 이미 생성한 embedding을 재사용해 중복 embedding API 호출을 방지했습니다.변경 사항 (있다면)
search_tsvector를 INSERT 시점에 함께 저장하도록 변경UPDATE ... FROM regulation_document로 검색 벡터를 갱신하던 흐름 제거query_embedding재사용search_tsvector생성 방식 관련 repository 테스트 수정리뷰 포인트
search_tsvector를 INSERT 시점에 계산하는 방식이 적절한지CREATE INDEX유지 판단이 현재 운영 방식에 적절한지regulation_chunk쓰기는 사용자 채팅 경로가 아니라 관리자성 규정 적재/수정 경로입니다.테스트
/docs수동 확인pytest실행스크린샷