From df83dbbe2a071637ed53a3c062b469eb047e73a7 Mon Sep 17 00:00:00 2001 From: getsolaris Date: Thu, 8 Aug 2024 13:07:48 +0900 Subject: [PATCH] feat: add nested/has_child inner_hits --- src/types/queries.ts | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/types/queries.ts b/src/types/queries.ts index d2a61df..708b275 100644 --- a/src/types/queries.ts +++ b/src/types/queries.ts @@ -1,4 +1,4 @@ -import {Coordinate, PrimitiveValue, PrimitiveValueArray, Script} from './common' +import {Coordinate, PrimitiveValue, PrimitiveValueArray, Script, Sort} from './common' // Match all queries @@ -460,6 +460,19 @@ export interface NestedQuery { query: Query score_mode?: 'avg' | 'sum' | 'min' | 'max' | 'none' ignore_unmapped?: boolean + inner_hits?: { + _source?: + | false + | string + | string[] + | {includes: string[]} + | {excludes: string[]} + | {includes: string[]; excludes: string[]} + size?: number + sort?: Sort + from?: number + name?: string + }[] } } @@ -471,6 +484,19 @@ export interface HasChildQuery { min_children?: number max_children?: number ignore_unmapped?: boolean + inner_hits?: { + _source?: + | false + | string + | string[] + | {includes: string[]} + | {excludes: string[]} + | {includes: string[]; excludes: string[]} + size?: number + sort?: Sort + from?: number + name?: string + }[] } }