Merge pull request #28400 from bsander/elasticsearch-named-queries

Elasticsearch: Support named queries in search response
This commit is contained in:
Armando Aguirre
2018-08-27 14:04:42 -07:00
committed by GitHub
2 changed files with 16 additions and 0 deletions

View File

@@ -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]

View File

@@ -645,6 +645,7 @@ export interface SearchResponse<T> {
fields?: any;
highlight?: any;
inner_hits?: any;
matched_queries?: string[];
sort?: string[];
}>;
};