algoliasearch-client-go
algoliasearch-client-go copied to clipboard
Avoid unmarshalling QueryRes.Hits into json default types
- Algolia Client Version: v3.30.1
- Language Version: 1.20
Description
During the unmarshalling of the QueryRes object, the existing implementation will completely unmarshal each hit object into json default types. As a result, the method QueryRes.UnmarshalHits
remarshals the default types just to unmarshal again into the users's desired type. For large result sets and/or large objects, this can be wasteful.
~PR incoming...~ PR
Steps To Reproduce
res, _index.Search(query, params...)
algoliaObjectResults := []AlgoliaObject{}
res.UnmarshalHits(&algoliaObjectResults)