Skip to content
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

Typed API: Get and document not found #678

Closed
rbcervilla opened this issue Jun 7, 2023 · 2 comments
Closed

Typed API: Get and document not found #678

rbcervilla opened this issue Jun 7, 2023 · 2 comments
Assignees

Comments

@rbcervilla
Copy link

When I try to get a document that doesn't exist, returned values dont't make sense.

Example

res, err := es.Get("index_name", "id_not_exists").Do(context.Background())

Returned values are a nil response and error ElasticsearchError with Status 0

I think returned values should be nil error with Response

Response{
    Index_: "index_name",
    Id_: "id_not_exists",
    Found: false,
}

Or maybe a nil response and ElasticsearchError with Status 404

Is it correct?

@Anaethelion Anaethelion self-assigned this Jun 9, 2023
@Anaethelion
Copy link
Contributor

Thank you for reporting this.

Your reasoning is correct and it seems the specification is missing this exceptions in the Get response.

I'll add that and update this issue when the API has been regenerated!

@Anaethelion
Copy link
Contributor

Fixed in release release/8.8.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants