TLDR alanx encountered a deserialization issue with Zincsearch's go-sdk. Prabhat recommended using go-elasticsearch, which resolved the problem.
The error msg is: Error when calling `SearchApi.Search``: json: cannot unmarshal array into Go struct field MetaAggregationResponse.aggregations.buckets of type map[string]interface {}. Not sure if I'm using it incorrectly, hope someone can answer this question
Debug the code locally and find that the error appears on line 430 of api_search.go. Before this line of code, the JSON data body returned by the server has been correctly obtained.
SDK might be a little old and we may need to update it. Can you try
I've tried it and it works, thanks.
cool
alanx
Thu, 09 Mar 2023 06:18:15 UTCHello, I'm trying to use zincsearch's go-sdk to do aggregation queries, but it looks like the sdk doesn't do proper JSON deserialization based on the real type of MetaAggregationResponse.Bucket.