Skip to content

Add _data_stream metadata to SearchHit for _search response #132476

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

seanzatzdev
Copy link

@seanzatzdev seanzatzdev commented Aug 5, 2025

Per #112750 , this PR adds the _data_stream metadata field to the Search Hit class and displays it in the response for _search

e.g.

{
    "took": 47,
    "timed_out": false,
    "_shards": {
        "total": 1,
        "successful": 1,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": {
            "value": 1,
            "relation": "eq"
        },
        "max_score": 1.0,
        "hits": [
            {
                "_index": ".ds-logs-myapp-default-2025.08.05-000001",
                "_data_stream": "logs-myapp-default",
                "_id": "AZh64tcIiR68mRpOTMUC",
                "_score": 1.0,
                "_source": {
                    "@timestamp": "2099-05-06T16:21:15.000Z",
                    "message": "192.0.2.42 -[06/May/2099:16:21:15] \"GET /images/bg.jp..."
                }
            }
        ]
    }
}

@seanzatzdev seanzatzdev force-pushed the feature/data_stream_in_search_hit branch from 22834bb to 6640cdd Compare August 6, 2025 19:32
@seanzatzdev seanzatzdev requested a review from masseyke August 7, 2025 03:16
@seanzatzdev seanzatzdev marked this pull request as ready for review August 7, 2025 03:17
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Aug 7, 2025
@seanzatzdev seanzatzdev added :Data Management/Data streams Data streams and their lifecycles Team:Data Management Meta label for data/management team labels Aug 7, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine elasticsearchmachine removed the needs:triage Requires assignment of a team area label label Aug 7, 2025
@seanzatzdev seanzatzdev linked an issue Aug 7, 2025 that may be closed by this pull request
@elasticsearchmachine
Copy link
Collaborator

Hi @seanzatzdev, I've created a changelog YAML for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Data streams Data streams and their lifecycles >feature Team:Data Management Meta label for data/management team v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add _data_stream meta field to search hits
2 participants