Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] 검색 기능 구현 #37

Merged
merged 17 commits into from
Jan 28, 2025
Merged

[Feat] 검색 기능 구현 #37

merged 17 commits into from
Jan 28, 2025

Conversation

chanmin-00
Copy link
Member

@chanmin-00 chanmin-00 commented Jan 26, 2025

#️⃣연관된 이슈

Close #35

📝작업 내용

게시물, 뉴스, 용어 사전 검색 기능 구현

  • 키워드 별 검색을 Querydsl 처리, 제목이나 내용에 키워드가 포함함될 경우 결과값에 추가
  • 자주 조회되는 키워드나 api의 경우 DB 접근 최소화를 위해 캐싱 기능 설정
  • 캐싱된 데이터는 동기화를 위해 1분 주기로 만료
image

최근 검색어 조회 및 삭제 기능 구현

  • 검색 api 호출 시 keyword를 입력받아 Redis에 저장
  • 사용자별로 최대 20개 저장되면 만료기간은 7일
image

뉴스 및 게시물 데이터 캐싱 적용

image

목록 조회 시 사용자 스크랩 여부 추가

image
  • Term, News, Post 엔터티에 DB에 저장되지 않는 @transient 스크랩 여부 확인 필드 추가
image
  • 목록 조회 시 Scrap 엔터티랑 조인, 스크랩 엔터티 join 여부에 따라 필드 true, false 여부 설정

기본 Batch Size 조정

image
  • 쿼리 대량 발생 방지 위해 기본 Batch Size 조정

💬리뷰 요구사항(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

- 자주 조회되는 데이터 캐싱 할 수 있도록 설정
- 캐싱 만료시간은 1분으로 짧게 설정
- 일반 게시글 검색
- 톡톡 게시글 검색
- 뉴스 검색
- 용어 검색
- 최근 검색어 조회, 삭제, 전체 삭제
- 일반 게시글 검색
- 톡톡 게시글 검색
- 뉴스 검색
- 용어 검색
- 최근 검색어 조회, 삭제, 전체 삭제
@chanmin-00 chanmin-00 added the ✨ Feat 새로운 기능 추가 label Jan 26, 2025
@chanmin-00 chanmin-00 self-assigned this Jan 26, 2025
Copy link
Member

@chaen-ing chaen-ing left a comment

Choose a reason for hiding this comment

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

캐싱, redis 기능 너무 잘 활용하시는 것 같아요!! 수고하셨습니다💯👍

Copy link
Member Author

@chanmin-00 chanmin-00 left a comment

Choose a reason for hiding this comment

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

뉴스, 게시물, 용어에 스크랩 여부만 추가하도록 하겠습니다

@chanmin-00 chanmin-00 added the ♻️ Refactor 코드 리팩토링 label Jan 28, 2025
.fetch();
}
private List<News> getNewsWithScrapByPageable(
Pageable pageable, BooleanExpression predicate, NewsSort newsSort, long userId) {
Copy link
Member Author

Choose a reason for hiding this comment

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

쿼리 수정했습니다

Copy link
Member

Choose a reason for hiding this comment

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

넵 확인했습니다!!

@chanmin-00 chanmin-00 merged commit 54738ad into develop Jan 28, 2025
@chanmin-00 chanmin-00 deleted the feat/search-#35 branch February 6, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♻️ Refactor 코드 리팩토링 ✨ Feat 새로운 기능 추가
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat] 검색 기능을 구현한다.
2 participants