diff --git a/src/main/java/com/umc/naoman/domain/photo/elasticsearch/repository/PhotoEsClientRepository.java b/src/main/java/com/umc/naoman/domain/photo/elasticsearch/repository/PhotoEsClientRepository.java index e28a209..fd6f43d 100644 --- a/src/main/java/com/umc/naoman/domain/photo/elasticsearch/repository/PhotoEsClientRepository.java +++ b/src/main/java/com/umc/naoman/domain/photo/elasticsearch/repository/PhotoEsClientRepository.java @@ -269,20 +269,18 @@ public List deletePhotoEsByShareGroupId(Long shareGroupId) { } //특정 사진에 특정 맴버 다운로드 태그 추가 - public void addDownloadTag(List photoEs, Long memberId){ - List fieldValueList = photoEs.stream() - .map(photo -> FieldValue.of(photo.getName())) + public void addDownloadTag(List photoUrlList, Long memberId){ + List fieldValueList = photoUrlList.stream() + .map(FieldValue::of) .toList(); - String routing = photoEs.get(0).getShareGroupId().toString(); Map params = new HashMap<>(); params.put("memberId", JsonData.of(memberId)); try { elasticsearchClient.updateByQuery(u -> u .index("photos_es") - .routing(routing) .query(q -> q .terms(t -> t - .field("name") + .field("url") .terms(te -> te.value(fieldValueList)) ) )