From b1f91f1a0ae5d09da92cf0859b0ff92410cdb6e3 Mon Sep 17 00:00:00 2001 From: Laura Trotta <153528055+l-trotta@users.noreply.github.com> Date: Thu, 30 May 2024 10:02:20 +0200 Subject: [PATCH] optional field id (#2592) --- output/openapi/elasticsearch-serverless-openapi.json | 3 +-- output/schema/schema.json | 2 +- output/typescript/types.ts | 2 +- specification/_global/search/_types/hits.ts | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 5164d814c0..207943c3f2 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -32366,8 +32366,7 @@ } }, "required": [ - "_index", - "_id" + "_index" ] }, "_types:IndexName": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 8fe02746e0..c32f8e7219 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -35609,7 +35609,7 @@ { "esQuirk": "'_id' is not available when using 'stored_fields: _none_'\non a search request. Otherwise the field is always present on hits.", "name": "_id", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 9a3b6a6e81..cda90a5fbc 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -1453,7 +1453,7 @@ export type SearchHighlighterType = 'plain' | 'fvh' | 'unified'| string export interface SearchHit { _index: IndexName - _id: Id + _id?: Id _score?: double | null _explanation?: ExplainExplanation fields?: Record diff --git a/specification/_global/search/_types/hits.ts b/specification/_global/search/_types/hits.ts index 89f82c4631..a4300dd5c1 100644 --- a/specification/_global/search/_types/hits.ts +++ b/specification/_global/search/_types/hits.ts @@ -43,7 +43,7 @@ export class Hit { * @es_quirk '_id' is not available when using 'stored_fields: _none_' * on a search request. Otherwise the field is always present on hits. */ - _id: Id + _id?: Id _score?: double | null _explanation?: Explanation fields?: Dictionary