Skip to content

Missing Public Constructor on Type Elastic.Clients.Elasticsearch.Fields #8152

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

Closed
DavidHoechtlJH opened this issue Apr 19, 2024 · 2 comments · Fixed by #8156
Closed

Missing Public Constructor on Type Elastic.Clients.Elasticsearch.Fields #8152

DavidHoechtlJH opened this issue Apr 19, 2024 · 2 comments · Fixed by #8156
Labels

Comments

@DavidHoechtlJH
Copy link

**Elastic.Clients.Elasticsearch version 8.13.7

**Elasticsearch version 8.12.2

**.NET runtime version .net 8

**Operating system version windows 11

I want to declare a instance of MulitMatchQuery with multiple Fields. The property of MulitMatchQuery.Fields is of Type Fields, which i cannot initialize.

A clear and concise description of what the bug is.
Missing public constructor

Steps to reproduce:

  1. Install nuget Elastic.Clients.Elasticsearch 8.13.7
  2. Try initialize a Fields instance
@DavidHoechtlJH DavidHoechtlJH added 8.x Relates to a 8.x client version Category: Bug labels Apr 19, 2024
@DavidHoechtlJH
Copy link
Author

DavidHoechtlJH commented Apr 19, 2024

I see, it inherits from IEnumerable<Field> so i can pass that instead of a fieldsinstance. I think this is very confusing tho, is this as expected ?

@flobernd
Copy link
Member

@DavidHoechtlJH Yes, take a look at the different implicit conversion operators of this class. You can even use lambda expressions to initialize the Fields.

I think it's good practice to have matching static methods for each implicit operator like "Fields.FromStrings(...)" etc. I'll try to add these in one of the next releases.

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

Successfully merging a pull request may close this issue.

2 participants