Skip to content

Commit

Permalink
fix : 공유그룹 아이디로 photos_es 삭제 시, 공유그룹 아이디를 리스트로 받아오는 것에서 1개만 받아오는 것으로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
redblackblossom committed Aug 13, 2024
1 parent 4606e16 commit 38f43e0
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,7 @@ public List<Long> deletePhotoEsByFaceTag(Long memberId) {
}

//특정 공유 그룹의 사진 삭제 -> 해당 사진에서 감지된 얼굴벡터도 함께 샥제 return : 삭제된 사진의 rdsId
public List<Long> deletePhotoEsByShareGroupIdList(List<Long> shareGroupIdList) {
List<FieldValue> fieldValueShareGroupList = shareGroupIdList.stream()
.map(FieldValue::of)
.toList();
public List<Long> deletePhotoEsByShareGroupId(Long shareGroupId) {
SearchResponse<PhotoEs> response = null;
List<Long> rdsIdList = new ArrayList<>();
List<String> photoNameList = new ArrayList<>();
Expand All @@ -239,18 +236,18 @@ public List<Long> deletePhotoEsByShareGroupIdList(List<Long> shareGroupIdList) {
.from(0)
.size(5000)
.query(q -> q
.terms(t -> t
.term(t -> t
.field("shareGroupId")
.terms(te -> te.value(fieldValueShareGroupList))
.value(FieldValue.of(shareGroupId))
)
),
PhotoEs.class);
elasticsearchClient.deleteByQuery(d -> d
.index("photos_es")
.query(q -> q
.terms(t -> t
.term(t -> t
.field("shareGroupId")
.terms(te -> te.value(fieldValueShareGroupList))
.value(FieldValue.of(shareGroupId))
)
)
);
Expand Down

0 comments on commit 38f43e0

Please sign in to comment.