Skip to content

Commit 90beef6

Browse files
authored
Add missing fields to SearchTemplateResponse (#1335)
1 parent c3d09a2 commit 90beef6

File tree

4 files changed

+192
-13
lines changed

4 files changed

+192
-13
lines changed

output/schema/schema.json

Lines changed: 158 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_global/search/SearchResponse.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { Suggest } from './_types/suggester'
2929

3030
export class Response<TDocument> {
3131
body: {
32+
// Has to be kept in sync with SearchTemplateResponse
3233
took: long
3334
timed_out: boolean
3435
_shards: ShardStatistics

specification/_global/search_template/SearchTemplateResponse.ts

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,31 @@
1818
*/
1919

2020
import { HitsMetadata } from '@global/search/_types/hits'
21-
import { integer } from '@_types/Numeric'
22-
import { ShardStatistics } from '@_types/Stats'
21+
import { double, integer, long } from '@_types/Numeric'
22+
import { ClusterStatistics, ShardStatistics } from '@_types/Stats'
23+
import { Dictionary } from '@spec_utils/Dictionary'
24+
import { AggregateName, Id, ScrollId, SuggestionName } from '@_types/common'
25+
import { Aggregate } from '@_types/aggregations/Aggregate'
26+
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
27+
import { Profile } from '@global/search/_types/profile'
28+
import { Suggest } from '@global/search/_types/suggester'
2329

2430
export class Response<TDocument> {
2531
body: {
26-
_shards: ShardStatistics
32+
// Has to be kept in sync with SearchResponse
33+
took: long
2734
timed_out: boolean
28-
took: integer
35+
_shards: ShardStatistics
2936
hits: HitsMetadata<TDocument>
37+
aggregations?: Dictionary<AggregateName, Aggregate>
38+
_clusters?: ClusterStatistics
39+
fields?: Dictionary<string, UserDefinedValue>
40+
max_score?: double
41+
num_reduce_phases?: long
42+
profile?: Profile
43+
pit_id?: Id
44+
_scroll_id?: ScrollId
45+
suggest?: Dictionary<SuggestionName, Suggest<TDocument>[]>
46+
terminated_early?: boolean
3047
}
3148
}

0 commit comments

Comments
 (0)