Skip to content

Request to reintroduce .Documents<T>() method for InnerHits for automatic document conversionΒ #7921

@gise88

Description

@gise88

Is your feature request related to a problem? Please describe. && Describe the solution you'd like
I'd like to request the reintroduction of the .Documents<T>() method, which was available in the 6.x branch of the library (I'm uncertain about its presence in version 7.*). This method was highly valuable for automatically converting every document in a specific type.

Describe alternatives you've considered
I haven't found any already prepared alternatives, but I'm open to any suggestions!

Additional context
In the 6.x branch of the library, the .Documents<T>() method was located in the src\Nest\Search\Search\Hits\InnerHitsMetaData.cs file and was defined as follows:

public IEnumerable<T> Documents<T>() where T : class
{
    if (Hits == null || !Hits.HasAny())
        return Enumerable.Empty<T>();

    return Hits.Select(hit => hit.Source.As<T>()).ToList();
}

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