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

Incorrect HTTP Method used when indexing documents with no ID inference #7057

Closed
stevejgordon opened this issue Dec 5, 2022 · 0 comments · Fixed by #7058
Closed

Incorrect HTTP Method used when indexing documents with no ID inference #7057

stevejgordon opened this issue Dec 5, 2022 · 0 comments · Fixed by #7058
Labels
8.x Relates to 8.x client version
Milestone

Comments

@stevejgordon
Copy link
Contributor

Elastic.Clients.Elasticsearch version: 8.0.0-rc.2, 8.0.0 and 8.0.1

Dynamic HttpMethod

Steps to reproduce:

  1. Index an object with no ID inference
public class Person
{
    public string? FirstName { get; init; }
}

var response = await client.IndexAsync(new Person { FirstName = "Steve" }, request => request.Index("product-index_001"));

Expected behavior
Expect the HttpMethod to be POST, as no ID is inferrable for the URL path.

Actual behavior
HttpMethod is PUT, which results in a 405 status code from the server for the URL path /product-index_001/_doc/

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

Successfully merging a pull request may close this issue.

1 participant