From c32fdbaedc0e64d6a9b18197c1855fea51805eca Mon Sep 17 00:00:00 2001 From: Sylvain Wallez Date: Thu, 16 Dec 2021 16:33:40 +0100 Subject: [PATCH 1/2] max_score and _score are required (and can be null) --- specification/_global/search/_types/hits.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/_global/search/_types/hits.ts b/specification/_global/search/_types/hits.ts index 6ed5ddb664..924610f634 100644 --- a/specification/_global/search/_types/hits.ts +++ b/specification/_global/search/_types/hits.ts @@ -40,7 +40,7 @@ import { Sort, SortResults } from '@_types/sort' export class Hit { _index: IndexName _id: Id - _score?: double | null + _score: double | null _explanation?: Explanation fields?: Dictionary highlight?: Dictionary @@ -64,7 +64,7 @@ export class HitsMetadata { total?: TotalHits | long hits: Hit[] - max_score?: double | null + max_score: double | null } export class HitMetadata { From 9f5f35c92ad2839983bb7fa8522f3ceea7ee627b Mon Sep 17 00:00:00 2001 From: Sylvain Wallez Date: Thu, 16 Dec 2021 17:32:06 +0100 Subject: [PATCH 2/2] Better with "make contrib" --- output/schema/schema.json | 4 ++-- output/typescript/types.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 69ccc477bb..4a1c3d0346 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -25501,7 +25501,7 @@ }, { "name": "_score", - "required": false, + "required": true, "type": { "items": [ { @@ -25794,7 +25794,7 @@ }, { "name": "max_score", - "required": false, + "required": true, "type": { "items": [ { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 4031af7df4..09d63f5b07 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -1246,7 +1246,7 @@ export type SearchHighlighterType = SearchBuiltinHighlighterType | string export interface SearchHit { _index: IndexName _id: Id - _score?: double | null + _score: double | null _explanation?: ExplainExplanation fields?: Record highlight?: Record @@ -1267,7 +1267,7 @@ export interface SearchHit { export interface SearchHitsMetadata { total?: SearchTotalHits | long hits: SearchHit[] - max_score?: double | null + max_score: double | null } export interface SearchInnerHits {