Skip to content

Commit 345d33a

Browse files
committed
Explain why this is not required
1 parent 39b796f commit 345d33a

File tree

1 file changed

+6
-0
lines changed
  • specification/_global/search/_types

1 file changed

+6
-0
lines changed

specification/_global/search/_types/hits.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ export class Hit<TDocument> {
4444
* on a search request. Otherwise the field is always present on hits.
4545
*/
4646
_id?: Id
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
4750
_score?: double | null
4851
_explanation?: Explanation
4952
fields?: Dictionary<string, UserDefinedValue>
@@ -69,6 +72,9 @@ export class HitsMetadata<T> {
6972
total?: TotalHits | long
7073
hits: Hit<T>[]
7174

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
7278
max_score?: double | null
7379
}
7480

0 commit comments

Comments
 (0)