Skip to content

Commit 572531f

Browse files
authored
Revert "max_score and _score are required (and can be null)" (#5248)
* Revert "max_score and _score are required (and can be null) (#1144)" This reverts commit 788ceeb. * Explain why this is not required
1 parent 3df5efb commit 572531f

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

output/schema/schema.json

Lines changed: 2 additions & 2 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: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_global/search/_types/hits.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ export class Hit<TDocument> {
4444
* on a search request. Otherwise the field is always present on hits.
4545
*/
4646
_id?: Id
47-
_score: double | null
47+
// While _score is always returned by Elasticsearch, making it required
48+
// breaks downstream JavaScript users for little added benefit
49+
// See https://github.com/elastic/elasticsearch-specification/pull/5248
50+
_score?: double | null
4851
_explanation?: Explanation
4952
fields?: Dictionary<string, UserDefinedValue>
5053
highlight?: Dictionary<string, string[]>
@@ -69,7 +72,10 @@ export class HitsMetadata<T> {
6972
total?: TotalHits | long
7073
hits: Hit<T>[]
7174

72-
max_score: double | null
75+
// While max_score is always returned by Elasticsearch, making it required
76+
// breaks downstream JavaScript users for little added benefit
77+
// See https://github.com/elastic/elasticsearch-specification/pull/5248
78+
max_score?: double | null
7379
}
7480

7581
export class HitMetadata<TDocument> {

0 commit comments

Comments
 (0)