Skip to content

MaxScore not filled on SearchResponse at the root level but only in the HitsMetadata #7886

Open
@TheFireCookie

Description

@TheFireCookie

Elastic.Clients.Elasticsearch version:
8.9.1

Elasticsearch version:
8.9.0

.NET runtime version:
7.0.10

Operating system version:
Windows 11

Description of the problem including expected versus actual behavior:
Do a search with .TrackScore() enabled and then look at the value of the MaxScore property of the SearchResponse, it's always at null even if there is a value in the JSON.

Steps to reproduce:

  1. Do a search with .TrackScore() enabled
  2. Check the JSON answered, the max_score property is there
  3. Check the SearchResponse class, no MaxScore property is set at the root level even if the property is available only at the HitsMetadata level.

Expected behavior
MaxScore is set correctly at both level or root level is deleted.

Json sent:

{
    "track_scores": true
}

Json received:

{
    "took": 1,
    "timed_out": false,
    "_shards": {
        "total": 1,
        "successful": 1,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": {
            "value": 5,
            "relation": "eq"
        },
        "max_score": 1.0,
....
}

.NET code
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions