You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the problem including expected versus actual behavior: MultiMatchQuery has a Fields property of Elastic.Clients.Elasticsearch.Fields? type. QueryStringQuery and SimpleQueryStringQuery have a Fields property of ICollection<Elastic.Clients.Elasticsearch.Field>? type.
Is there a reason for this change in the new version of the library? Shouldn't these be of the same Elastic.Clients.Elasticsearch.Fields? type?
Steps to reproduce:
1.
2.
3.
Expected behavior
A clear and concise description of what you expected to happen.
Provide ConnectionSettings (if relevant):
Provide DebugInformation (if relevant):
The text was updated successfully, but these errors were encountered:
thanks again for testing the new version and reporting rough edges. That's super helpful 🙂
Semantics for Fields and Field[] are actually different. The specification defines Fields as:
exporttypeFields=Field|Field[]
We call this a "single-or-many" construct. The ES server accepts the JSON property in a singular form "field" and in an array form ["field", "..."].
Field[] on the other hand, only accepts the array form.
The old generator incorrectly replaced Field[] with Fields which caused an issue with e.g. the stored_fields that Steve tried to fix in #8018.
The current way of generating these properties is semantically correct, but a litte bit cumbersome to use. A proper fix that I've planned involves removing the [JsonConverter(typeof(FieldsConverter))] attribute from the Fields class. Afterwards, the generator will emit Field[] properties using the Fields type again, but dynamically places converter attributes on the properties - depending on the semantics (either FieldsConverter or FieldArrayConverter).
I expect to release this improvement already in the beginning of the next week.
Elastic.Clients.Elasticsearch version: 8.13.1
Elasticsearch version: 8.11
.NET runtime version: 8.0
Operating system version:
Description of the problem including expected versus actual behavior:
MultiMatchQuery
has aFields
property ofElastic.Clients.Elasticsearch.Fields?
type.QueryStringQuery
andSimpleQueryStringQuery
have aFields
property ofICollection<Elastic.Clients.Elasticsearch.Field>?
type.Is there a reason for this change in the new version of the library? Shouldn't these be of the same
Elastic.Clients.Elasticsearch.Fields?
type?Steps to reproduce:
1.
2.
3.
Expected behavior
A clear and concise description of what you expected to happen.
Provide
ConnectionSettings
(if relevant):Provide
DebugInformation
(if relevant):The text was updated successfully, but these errors were encountered: