From c6ae866d1a2057474f2dd81f4103921e2f9402f4 Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Fri, 2 Jun 2023 15:42:27 -0500 Subject: [PATCH] Update APIs for 8.8.1 --- package.json | 4 ++-- src/api/api/search.ts | 2 +- src/api/types.ts | 13 +++++++++++++ src/api/typesWithBodyKey.ts | 13 +++++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ffc2e9741..994a766ac 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@elastic/elasticsearch", - "version": "8.8.0", - "versionCanary": "8.8.0-canary.2", + "version": "8.8.1", + "versionCanary": "8.8.1-canary.1", "description": "The official Elasticsearch client for Node.js", "main": "index.js", "types": "index.d.ts", diff --git a/src/api/api/search.ts b/src/api/api/search.ts index 6c757cc9b..3a45a4b78 100644 --- a/src/api/api/search.ts +++ b/src/api/api/search.ts @@ -42,7 +42,7 @@ export default async function SearchApi> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptions): Promise> export default async function SearchApi> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['index'] - const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'ext', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'knn', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats'] + const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'ext', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'knn', 'rank', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats'] const querystring: Record = {} // @ts-expect-error const userBody: any = params?.body diff --git a/src/api/types.ts b/src/api/types.ts index de9009bc3..beb9b6c9e 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -1140,6 +1140,7 @@ export interface SearchRequest extends RequestBase { indices_boost?: Record[] docvalue_fields?: (QueryDslFieldAndFormat | Field)[] knn?: KnnQuery | KnnQuery[] + rank?: RankContainer min_score?: double post_filter?: QueryDslQueryContainer profile?: boolean @@ -2368,6 +2369,13 @@ export interface QueryVectorBuilder { text_embedding?: TextEmbedding } +export interface RankBase { +} + +export interface RankContainer { + rrf?: RrfRank +} + export interface RecoveryStats { current_as_source: long current_as_target: long @@ -2412,6 +2420,11 @@ export interface Retries { export type Routing = string +export interface RrfRank { + rank_constant?: long + window_size?: long +} + export interface ScoreSort { order?: SortOrder } diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index c7d803114..5a6360942 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -1194,6 +1194,7 @@ export interface SearchRequest extends RequestBase { indices_boost?: Record[] docvalue_fields?: (QueryDslFieldAndFormat | Field)[] knn?: KnnQuery | KnnQuery[] + rank?: RankContainer min_score?: double post_filter?: QueryDslQueryContainer profile?: boolean @@ -2441,6 +2442,13 @@ export interface QueryVectorBuilder { text_embedding?: TextEmbedding } +export interface RankBase { +} + +export interface RankContainer { + rrf?: RrfRank +} + export interface RecoveryStats { current_as_source: long current_as_target: long @@ -2485,6 +2493,11 @@ export interface Retries { export type Routing = string +export interface RrfRank { + rank_constant?: long + window_size?: long +} + export interface ScoreSort { order?: SortOrder }