Closed
Description
Elastic.Clients.Elasticsearch version: 8.15.6
Elasticsearch version: 8.15.1
.NET runtime version: 8.x
Operating system version: Any
Description of the problem including expected versus actual behavior:
I noticed a lot of inconsistencies / verbosity when converting to the new api's. I feel like the old one was more consistent and easy to use.
Previous
if (ids is { Count: > 0 })
node.Parent.SetQuery(new TermsQuery { Field = "id", Terms = ids });
else
node.Parent.SetQuery(new TermQuery { Field = "id", Value = "none" });
New
if (ids is { Count: > 0 })
node.Parent.SetQuery(new TermsQuery { Field = "id", Term = new TermsQueryField(ids.Select(FieldValue.String).ToArray()) });
else
node.Parent.SetQuery(new TermQuery("id") { Value = "none" });
Expected behavior
It doesn't make any sense why these are so much different, and all the extra casts (no implicit conversion for field values).
Reference: FoundatioFx/Foundatio.Parsers#84
Metadata
Metadata
Assignees
Labels
No labels