Open
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:
While upgrading I've noticed a few things that really made the conversion harder than it had to be and I feel like the feedback below would have made things easier. I get that the purpose of the rewrite was to make maintenance easier, but on the other end is consumers/customers that have large investments in existing api's / elastic.
- Defining new aggregations with a (dynamic agg name) using your object model is impossible now as you can't define agg names (only internal variant name and variant...) kinda makes the aggregation type useless for consumers.
- Kept the existing interfaces, they were not hurting anything especially around code gen.
- leverage interfaces more for very common fields like IProperty.Fields (tons of properties have fields, other common properties) having something like IHaveField or anything... This change with concrete types forces us to check tons of concrete types which makes maintaining it even harder as new types are added. No common interface for the tons of aggregation types seems like a miss?
- There is 0 point to have such an internalized api (worst case make the setters internal / private). This has made things much harder than it should be especially around aggregations / sorting. The property names chosen for some like VariantName kinda adds to the confusion.
- 1 way implicit conversions for aggregations requires lots of boxing, type casting, and harder to go back the other way, especially with internalized. Also this method might make your serializer implementation slightly easier to generate, but harder to work with. It also means the aggregations don't actually represent what is supported (e.g., meta, sub aggs).
- Leverage debugger displays / record types for better dx.
- Using library types like FluentDictionary for SearchRequest Aggregations. I get there is a constructor that takes a dictionary but using custom types like this does make using the descriptors a bit harder for some use cases.8. I've logged other issues below which seem like bigger problem areas to solve.Expected behavior
Easier to use api's and less internalized things leading to a better experience.
Reference: FoundatioFx/Foundatio.Parsers#84
Also apologies if the labels are incorrect for or this issue:
- 8.15.6 - Bring back Aggregation LocalMetadata #8334
- 8.15.6 - Make public SortOptions.AdditionalPropertyName #8335
- 8.15.6 - Bring Back IProperty.Name #8336
- 8.15.6 - IPropertyWithClrOrigin replacements? #8337
- 8.15.6 - ExtendedBounds -> ExtendedBoundsDate needs implicit convertors for anchored DateTime #8338
Thank you.