Skip to content

[Backport 8.0] Add missing fields to SearchTemplateResponse #1336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 158 additions & 7 deletions output/schema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions output/typescript/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions specification/_global/search/SearchResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { Suggest } from './_types/suggester'

export class Response<TDocument> {
body: {
// Has to be kept in sync with SearchTemplateResponse
took: long
timed_out: boolean
_shards: ShardStatistics
Expand Down
25 changes: 21 additions & 4 deletions specification/_global/search_template/SearchTemplateResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,31 @@
*/

import { HitsMetadata } from '@global/search/_types/hits'
import { integer } from '@_types/Numeric'
import { ShardStatistics } from '@_types/Stats'
import { double, integer, long } from '@_types/Numeric'
import { ClusterStatistics, ShardStatistics } from '@_types/Stats'
import { Dictionary } from '@spec_utils/Dictionary'
import { AggregateName, Id, ScrollId, SuggestionName } from '@_types/common'
import { Aggregate } from '@_types/aggregations/Aggregate'
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
import { Profile } from '@global/search/_types/profile'
import { Suggest } from '@global/search/_types/suggester'

export class Response<TDocument> {
body: {
_shards: ShardStatistics
// Has to be kept in sync with SearchResponse
took: long
timed_out: boolean
took: integer
_shards: ShardStatistics
hits: HitsMetadata<TDocument>
aggregations?: Dictionary<AggregateName, Aggregate>
_clusters?: ClusterStatistics
fields?: Dictionary<string, UserDefinedValue>
max_score?: double
num_reduce_phases?: long
profile?: Profile
pit_id?: Id
_scroll_id?: ScrollId
suggest?: Dictionary<SuggestionName, Suggest<TDocument>[]>
terminated_early?: boolean
}
}