From 70e3b7e6bf3e4f34323f56ce53ebdfd781969c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Stra=C3=9Fer?= Date: Thu, 31 Aug 2023 16:36:27 +0200 Subject: [PATCH 1/2] Added the similarity parameter to the KnnQuery type --- output/schema/schema.json | 18 +++++++++++++++--- output/typescript/types.ts | 1 + specification/_types/Knn.ts | 2 ++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 9c6945aaf0..6a1268a077 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -42380,9 +42380,21 @@ ], "kind": "union_of" } + }, + { + "description": "The minimum similarity for a vector to be considered a match", + "name": "similarity", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } } ], - "specLocation": "_types/Knn.ts#L26-L41" + "specLocation": "_types/Knn.ts#L26-L43" }, { "kind": "interface", @@ -43721,7 +43733,7 @@ } } ], - "specLocation": "_types/Knn.ts#L43-L46", + "specLocation": "_types/Knn.ts#L45-L48", "variants": { "kind": "container" } @@ -45907,7 +45919,7 @@ } } ], - "specLocation": "_types/Knn.ts#L48-L51" + "specLocation": "_types/Knn.ts#L50-L53" }, { "kind": "enum", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 324160725b..69c8ba30d4 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2322,6 +2322,7 @@ export interface KnnQuery { num_candidates: long boost?: float filter?: QueryDslQueryContainer | QueryDslQueryContainer[] + similarity?: double } export interface LatLonGeoLocation { diff --git a/specification/_types/Knn.ts b/specification/_types/Knn.ts index 2a3b4a9422..6d8e450941 100644 --- a/specification/_types/Knn.ts +++ b/specification/_types/Knn.ts @@ -38,6 +38,8 @@ export interface KnnQuery { boost?: float /** Filters for the kNN search query */ filter?: QueryContainer | QueryContainer[] + /** The minimum similarity for a vector to be considered a match */ + similarity?: double } /** @variants container */ From c094841cb326b3b4bd8acc98aaedcd52c21ce372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Stra=C3=9Fer?= Date: Thu, 21 Sep 2023 07:55:46 +0200 Subject: [PATCH 2/2] changing type of the similarity field to float --- output/schema/schema.json | 2 +- output/typescript/types.ts | 2 +- specification/_types/Knn.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index a79e0798d6..b59c1a2df6 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -42778,7 +42778,7 @@ "type": { "kind": "instance_of", "type": { - "name": "double", + "name": "float", "namespace": "_types" } } diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 3023e4a20b..a5525780fc 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2339,7 +2339,7 @@ export interface KnnQuery { num_candidates: long boost?: float filter?: QueryDslQueryContainer | QueryDslQueryContainer[] - similarity?: double + similarity?: float } export interface LatLonGeoLocation { diff --git a/specification/_types/Knn.ts b/specification/_types/Knn.ts index 6d8e450941..3ac82a11ed 100644 --- a/specification/_types/Knn.ts +++ b/specification/_types/Knn.ts @@ -18,7 +18,7 @@ */ import { Field } from '@_types/common' -import { long, double, float } from '@_types/Numeric' +import { long, float } from '@_types/Numeric' import { QueryContainer } from './query_dsl/abstractions' export type QueryVector = float[] @@ -39,7 +39,7 @@ export interface KnnQuery { /** Filters for the kNN search query */ filter?: QueryContainer | QueryContainer[] /** The minimum similarity for a vector to be considered a match */ - similarity?: double + similarity?: float } /** @variants container */