From 0e353e608744c26eb8f6cc9195ed567a9febb021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=BCth?= Date: Tue, 7 Feb 2023 13:51:42 +0100 Subject: [PATCH] Add missing model --- LICENSE.txt | 2 +- common/pom.xml | 2 +- grpc/pom.xml | 2 +- http/pom.xml | 2 +- .../http/model/collection/CollectionInfo.java | 8 +++-- .../model/collection/PayloadIndexInfo.java | 35 +++++++++++++++++++ .../model/collection/PayloadSchemaParams.java | 28 +++++++++++++++ .../io/metaloom/qdrant/client/json/Json.java | 2 +- pom.xml | 2 +- report/pom.xml | 2 +- 10 files changed, 75 insertions(+), 10 deletions(-) create mode 100644 http/src/main/java/io/metaloom/qdrant/client/http/model/collection/PayloadSchemaParams.java diff --git a/LICENSE.txt b/LICENSE.txt index ae8cc53..1013da8 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2021 Johannes Schüth + Copyright 2023 Johannes Schüth Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/common/pom.xml b/common/pom.xml index e9a983d..24da5f8 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -9,7 +9,7 @@ io.metaloom.qdrant qdrant-java-client - 0.9.1-SNAPSHOT + 0.10.0-SNAPSHOT Qdrant Java Client :: common diff --git a/grpc/pom.xml b/grpc/pom.xml index 1bb9a40..2c7dd49 100644 --- a/grpc/pom.xml +++ b/grpc/pom.xml @@ -9,7 +9,7 @@ io.metaloom.qdrant qdrant-java-client - 0.9.1-SNAPSHOT + 0.10.0-SNAPSHOT Qdrant Java Client :: grpc diff --git a/http/pom.xml b/http/pom.xml index b7ecdfd..2ae0bae 100644 --- a/http/pom.xml +++ b/http/pom.xml @@ -9,7 +9,7 @@ io.metaloom.qdrant qdrant-java-client - 0.9.1-SNAPSHOT + 0.10.0-SNAPSHOT Qdrant Java Client :: http diff --git a/http/src/main/java/io/metaloom/qdrant/client/http/model/collection/CollectionInfo.java b/http/src/main/java/io/metaloom/qdrant/client/http/model/collection/CollectionInfo.java index c43f61c..924448c 100644 --- a/http/src/main/java/io/metaloom/qdrant/client/http/model/collection/CollectionInfo.java +++ b/http/src/main/java/io/metaloom/qdrant/client/http/model/collection/CollectionInfo.java @@ -1,5 +1,7 @@ package io.metaloom.qdrant.client.http.model.collection; +import java.util.Map; + import com.fasterxml.jackson.annotation.JsonProperty; import io.metaloom.qdrant.client.http.model.RestModel; @@ -28,7 +30,7 @@ public class CollectionInfo implements RestModel { private CollectionConfig config; @JsonProperty("payload_schema") - private PayloadIndexInfo payloadSchema; + private Map payloadSchema; public CollectionStatus getStatus() { return status; @@ -75,11 +77,11 @@ public CollectionInfo setConfig(CollectionConfig config) { return this; } - public PayloadIndexInfo getPayloadSchema() { + public Map getPayloadSchema() { return payloadSchema; } - public CollectionInfo setPayloadSchema(PayloadIndexInfo payloadSchema) { + public CollectionInfo setPayloadSchema(Map payloadSchema) { this.payloadSchema = payloadSchema; return this; } diff --git a/http/src/main/java/io/metaloom/qdrant/client/http/model/collection/PayloadIndexInfo.java b/http/src/main/java/io/metaloom/qdrant/client/http/model/collection/PayloadIndexInfo.java index de5d2b5..f73fc40 100644 --- a/http/src/main/java/io/metaloom/qdrant/client/http/model/collection/PayloadIndexInfo.java +++ b/http/src/main/java/io/metaloom/qdrant/client/http/model/collection/PayloadIndexInfo.java @@ -1,7 +1,42 @@ package io.metaloom.qdrant.client.http.model.collection; +import com.fasterxml.jackson.annotation.JsonProperty; + import io.metaloom.qdrant.client.http.model.RestModel; public class PayloadIndexInfo implements RestModel { + @JsonProperty("data_type") + private PayloadSchemaType dataType; + + private PayloadSchemaParams params; + + private int points; + + public PayloadSchemaType getDataType() { + return dataType; + } + + public PayloadIndexInfo setDataType(PayloadSchemaType dataType) { + this.dataType = dataType; + return this; + } + + public PayloadSchemaParams getParams() { + return params; + } + + public PayloadIndexInfo setParams(PayloadSchemaParams params) { + this.params = params; + return this; + } + + public int getPoints() { + return points; + } + + public PayloadIndexInfo setPoints(int points) { + this.points = points; + return this; + } } diff --git a/http/src/main/java/io/metaloom/qdrant/client/http/model/collection/PayloadSchemaParams.java b/http/src/main/java/io/metaloom/qdrant/client/http/model/collection/PayloadSchemaParams.java new file mode 100644 index 0000000..0f25ec1 --- /dev/null +++ b/http/src/main/java/io/metaloom/qdrant/client/http/model/collection/PayloadSchemaParams.java @@ -0,0 +1,28 @@ +package io.metaloom.qdrant.client.http.model.collection; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PayloadSchemaParams { + + KEYWORD("keyword"), + + INTEGER("integer"), + + FLOAT("float"), + + GEO("geo"), + + TEXT("text"); + + String name; + + private PayloadSchemaParams(String name) { + this.name = name; + } + + @JsonValue + public String getName() { + return name; + } + +} diff --git a/http/src/main/java/io/metaloom/qdrant/client/json/Json.java b/http/src/main/java/io/metaloom/qdrant/client/json/Json.java index 66600e9..440eb95 100644 --- a/http/src/main/java/io/metaloom/qdrant/client/json/Json.java +++ b/http/src/main/java/io/metaloom/qdrant/client/json/Json.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JacksonException; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; @@ -50,6 +49,7 @@ public final class Json { static { mapper = new ObjectMapper() .setSerializationInclusion(Include.NON_NULL); + //.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); SimpleModule module = new SimpleModule(); module.addDeserializer(NamedVector.class, new NamedVectorDeserializer()); diff --git a/pom.xml b/pom.xml index 0a596a0..08a38ec 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 io.metaloom.qdrant qdrant-java-client - 0.9.1-SNAPSHOT + 0.10.0-SNAPSHOT io.metaloom diff --git a/report/pom.xml b/report/pom.xml index 8d5dcc2..da2ebab 100644 --- a/report/pom.xml +++ b/report/pom.xml @@ -8,7 +8,7 @@ io.metaloom.qdrant qdrant-java-client - 0.9.1-SNAPSHOT + 0.10.0-SNAPSHOT Qdrant Java Client :: report