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
@Hades32 The way you are doing it is the only way possible, it wouldn't be possible to use generics using the methods from this library (for example something like client.Collection("companies").Documents().Search[Company](searchParameters)), because Go does not allow parametrized methods.
The only way would be to set the result type at client creation, but then that client is effectively bound to one index only. Or well, provide a convenience function like you did.
Another way would be to allow you to provide a pointer to the result struct that you want to unmarshall the result into - the signature for that argument in the Search function would simply be interface{}, so this wouldn't even require generics.
Search results are untyped (
map[string]any
) which makes this very unergonomic to useCurrently we're working around it with a custom search method
and matching types
The text was updated successfully, but these errors were encountered: