Skip to content

Commit

Permalink
refactor: ES dateTime 타입 및 쿼리 필터 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
mcodnjs committed Oct 13, 2023
1 parent 19a8407 commit 1cc9fce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ public class StudylogDocument {
@Field(type = FieldType.Text)
private String username;

@Field(type = FieldType.Text)
@Field(type = FieldType.Date, format = DateFormat.date_optional_time)
private LocalDateTime dateTime;
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private static void makeBoolQuery(
.must(defaultField(username, "username"))
// .must(defaultField(levels, "levelId"))
// .must(defaultField(missions, "missionId"))
.filter(rangeQuery(start, end))
// .filter(rangeQuery(start, end))
);
}

Expand Down Expand Up @@ -96,7 +96,6 @@ private static RangeQueryBuilder rangeQuery(LocalDate start, LocalDate end) {
if (Objects.isNull(end)) {
end = LocalDate.parse("99991231", DateTimeFormatter.BASIC_ISO_DATE);
}

return QueryBuilders.rangeQuery("dateTime")
.from(start)
.to(end);
Expand Down

0 comments on commit 1cc9fce

Please sign in to comment.