-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Top hits aggregation - support multitype type hits #2408
Comments
We have a special Then you can call |
Thank you, that might work as a workaround instead of |
* Use serializer when deserializing LazyDocument to T When converting a LazyDocument to type T, use the JsonNetSerializer configured, along with all registered contract resolvers. Fixes elastic#2788 * Direct cast * Add non-generic overload for As() Relates elastic#2408 (cherry picked from commit 109bcb0)
@llRandom while I agree this would be a super handy feature, in NEST 5.x it would be incredibly hard to introduce without backwards compatible breaking changes. Closing this as In NEST 6.x and up it will be possible to configure a serializer just for |
Describe the feature:
Current version doesn't allow to get deserialized documents from
TopHitsAggregate
aggregation object if they have different types. An attempt to use anobject
as a generic type leads to an exception. The only workaround I've found is to useNewtonsoft.Json.Linq.JObject
type for getting hits and then cast hits usingToObject(targetType)
method:The text was updated successfully, but these errors were encountered: