/
linto
/
opensearch-example
Обзор
Документация
Войти
/
linto
/
opensearch-example
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/main/java/com/example/demo/opensearch/model/Root.java
66 строк
2 KB
linto
init
30 июл 2025, 11:44
30 июл 2025, 11:44
dc5aaf3
Код
Авторство
О чём код?
package com.example.demo.opensearch.model; import java.time.Instant; import java.util.List; import java.util.UUID; import org.springframework.data.annotation.Id; import org.springframework.data.elasticsearch.annotations.DateFormat; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Dynamic; import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.annotations.FieldType; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; @Data @NoArgsConstructor @AllArgsConstructor @Builder @Document(indexName = "#{@indexProperties.name()}") public class Root { @Id private UUID id; @Field(name = "inn", type = FieldType.Keyword) private String inn; @Field(name = "name", type = FieldType.Text) private String name; @Field(name = "kpp", type = FieldType.Keyword) private String kpp; @Field(name = "ogrn", type = FieldType.Keyword) private String ogrn; @Field(name = "identities", type = FieldType.Nested, dynamic = Dynamic.STRICT) List<Identity> identities; @Field(name = "createdat", type = FieldType.Date, format = DateFormat.date_optional_time) private Instant createdat; @Field(name = "updatedat", type = FieldType.Date, format = DateFormat.date_optional_time) private Instant updatedat; @Field(name = "@timestamp", type = FieldType.Date, format = DateFormat.date_optional_time) private Instant timestamp; @Data @NoArgsConstructor public static class Identity { @Field(name = "id") private UUID id; @Field(name = "source") private UUID source; @Field(name = "code") private String code; } }