From 51deddd11304d2c4fc19160e9676916079a830f7 Mon Sep 17 00:00:00 2001 From: redblackblossom Date: Mon, 12 Aug 2024 22:54:31 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix=20:=20es=20=EB=8F=84=ED=81=90=EB=A8=BC?= =?UTF-8?q?=ED=8A=B8=20=EB=A7=A4=ED=95=91=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/photo/elasticsearch/index/sample_photo_vectors.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/umc/naoman/domain/photo/elasticsearch/index/sample_photo_vectors.json b/src/main/java/com/umc/naoman/domain/photo/elasticsearch/index/sample_photo_vectors.json index a034dc1..04ee4a4 100644 --- a/src/main/java/com/umc/naoman/domain/photo/elasticsearch/index/sample_photo_vectors.json +++ b/src/main/java/com/umc/naoman/domain/photo/elasticsearch/index/sample_photo_vectors.json @@ -14,8 +14,7 @@ "faceVector" : { "type": "dense_vector", "dims": 512, - "index": false, - "similarity" : "dot_product" + "index": false } } } From ec3402d1752ebed8168c78182dac3fe18fd4c9d7 Mon Sep 17 00:00:00 2001 From: redblackblossom Date: Mon, 12 Aug 2024 22:55:09 +0900 Subject: [PATCH 2/2] =?UTF-8?q?es=20=EC=82=AC=EC=A7=84=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EC=8B=9C=EA=B0=84=EC=88=9C=EC=84=9C=EB=A1=A4=20?= =?UTF-8?q?=EB=82=B4=EB=A6=BC=EC=B0=A8=EC=88=9C=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/PhotoEsClientRepository.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 5d53020..9653467 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 @@ -2,6 +2,7 @@ import co.elastic.clients.elasticsearch.ElasticsearchClient; import co.elastic.clients.elasticsearch._types.FieldValue; +import co.elastic.clients.elasticsearch._types.SortOrder; import co.elastic.clients.elasticsearch.core.BulkRequest; import co.elastic.clients.elasticsearch.core.BulkResponse; import co.elastic.clients.elasticsearch.core.SearchResponse; @@ -72,7 +73,8 @@ public Page findPhotoEsByShareGroupId(Long shareGroupId, Pageable pagea .size(pageable.getPageSize()) .sort(sort -> sort .field(f -> f - .field("createdAt"))) + .field("createdAt") + .order(SortOrder.Desc))) .query(q -> q .term(t -> t .field("shareGroupId") @@ -98,7 +100,8 @@ public Page findPhotoEsByShareGroupIdAndFaceTag(Long shareGroupId, Long .size(pageable.getPageSize()) .sort(sort -> sort .field(f -> f - .field("createdAt"))) + .field("createdAt") + .order(SortOrder.Desc))) .query(q -> q .bool(b -> b .must(m -> m @@ -135,7 +138,8 @@ public Page findPhotoEsByShareGroupIdAndNotFaceTag(Long shareGroupId, P .size(pageable.getPageSize()) .sort(sort -> sort .field(f -> f - .field("createdAt"))) + .field("createdAt") + .order(SortOrder.Desc))) .query(q -> q .bool(b -> b .must(m -> m