Skip to content

ElasticsearchResponse should include Id, Version, PrimaryTerm, SeqNo #8567

Open
@TCTroyBrown

Description

@TCTroyBrown

Elastic.Clients.Elasticsearch version: 9.0.6

Elasticsearch version: N/A

.NET runtime version: Net 8+

Operating system version: Windows 11

Description of the problem including expected versus actual behavior:
IndexResponse, DeleteResponse,CreateResponse, UpdateResponse all include Id, Version, PrimaryTerm, SeqNo directly, but which response it will be happens at runtime. If trying to examine those four fields in a shared method, it is not easy to consolidate the code. It forces checks on the response to see exactly which response type it is so it can be properly casted.

This used to be possible in NEST via WriteResponseBase but that was removed.

Expected behavior
Either ElasticsearchResponse should have these four fields or if that is too low level, there should be an intermediate derived class in between ElasticsearchResponse and the above four types to allow them to share those fields.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions