Skip to content

Commit

Permalink
Merge pull request #103 from Na-o-man/fix/#201/es_photo_es_order
Browse files Browse the repository at this point in the history
[Fix] es 사진 조회 내림차순으로 변경
  • Loading branch information
bflykky authored Aug 12, 2024
2 parents bfcdbe9 + ec3402d commit 4606e16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"faceVector" : {
"type": "dense_vector",
"dims": 512,
"index": false,
"similarity" : "dot_product"
"index": false
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -72,7 +73,8 @@ public Page<PhotoEs> 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")
Expand All @@ -98,7 +100,8 @@ public Page<PhotoEs> 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
Expand Down Expand Up @@ -135,7 +138,8 @@ public Page<PhotoEs> 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
Expand Down

0 comments on commit 4606e16

Please sign in to comment.