mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-13 12:37:16 +08:00
Merge pull request #28400 from bsander/elasticsearch-named-queries
Elasticsearch: Support named queries in search response
This commit is contained in:
@@ -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]
|
||||
|
||||
1
types/elasticsearch/index.d.ts
vendored
1
types/elasticsearch/index.d.ts
vendored
@@ -645,6 +645,7 @@ export interface SearchResponse<T> {
|
||||
fields?: any;
|
||||
highlight?: any;
|
||||
inner_hits?: any;
|
||||
matched_queries?: string[];
|
||||
sort?: string[];
|
||||
}>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user