Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/sql/precedent_fulltext.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ALTER TABLE precedent
ADD FULLTEXT idx_precedent_fulltext (notice, summary_of_the_judgment, precedent_content, case_name, case_number);
ADD FULLTEXT idx_precedent_fulltext (notice, summary_of_the_judgment, precedent_content, case_name, case_number);
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ public Page<LawsDto> searchLaws(LawSearchRequestDto searchRequest) {

List<LawsDto> content = query.fetch();

if (content.isEmpty()) {
return new PageImpl<>(content, pageable, 0);
}
// if (content.isEmpty()) {
// return new PageImpl<>(content, pageable, 0);
// }

// 조회한 법령 ID 목록 추출
List<Long> lawIds = content.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ public class SearchResponseDto {

@Schema(description = "판례 검색 결과 페이지")
private PageResponseDto precedents;
}

@Schema(description = "법령 + 판례 통합 총 건수")
private long lawPrecTotalElements;
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ public SearchResponseDto combinedSearch(SearchRequestDto request) {
response.setPrecedents(precResult == null ? null : (PageResponseDto) precResult);
}

// 통합 total 계산: laws.totalElements + precedents.totalElements
long lawsTotal = response.getLaws() != null ? response.getLaws().getTotalElements() : 0L;
long precTotal = response.getPrecedents() != null ? response.getPrecedents().getTotalElements() : 0L;
response.setLawPrecTotalElements(lawsTotal + precTotal);

if (request.isIncludeLaws() && request.isIncludePrecedents()
&& response.getLaws() == null && response.getPrecedents() == null) {
throw new RuntimeException("법령 및 판례 검색 모두 실패");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@