Skip to content

Conversation

seanzatzdev
Copy link
Contributor

@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.

Copy link
Member

@masseyke masseyke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we decided not to do this one because we don't want to introduce the runtime overhead of determining if the index is actually in a data stream to this API.

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.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add _data_stream meta field to search hits
3 participants