diff --git a/types/elasticsearch/elasticsearch-tests.ts b/types/elasticsearch/elasticsearch-tests.ts index 85574e3c91..68625bd5bb 100644 --- a/types/elasticsearch/elasticsearch-tests.ts +++ b/types/elasticsearch/elasticsearch-tests.ts @@ -37,6 +37,21 @@ client.search({ }, (error) => { }); +client.search({ + body: { + query: { + match_all: { + _name: 'test' + } + } + } +} +).then((body) => { + const hit = body.hits.hits[0]; + const names = hit && hit.matched_queries; +}, (error) => { +}); + client.indices.delete({ index: 'test_index', ignore: [404] diff --git a/types/elasticsearch/index.d.ts b/types/elasticsearch/index.d.ts index c791db72c3..a9dc133545 100644 --- a/types/elasticsearch/index.d.ts +++ b/types/elasticsearch/index.d.ts @@ -645,6 +645,7 @@ export interface SearchResponse { fields?: any; highlight?: any; inner_hits?: any; + matched_queries?: string[]; sort?: string[]; }>; };