typesense / typesense-go

Go client for Typesense: https://github.com/typesense/typesense
Apache License 2.0
208 stars 55 forks source link

Multi search result doesn't give Code and Message if something goes wrong #147

Open vamshiaruru opened 1 year ago

vamshiaruru commented 1 year ago

Description

If you make multiple searches using multisearch query, and if one of the queries causes an error somehow (for example a field which isn't a facet index is given as facet_by input), the response corresponding to that query is just an empty object and is not pouplated with code and message. This is because the response object is just SearchResult which doesn't have Code & Message fields, so when you unmarshal the data is gone. The way to fix this IMO would be to add a separate MultiSearchResultEle type which has everything in SearchResult but also has the Code and Error fields.

vamshiaruru commented 1 year ago

I would like to raise a PR but I am unable to get the generator working. I made manual changes in this fork: https://github.com/typesense/typesense-go/compare/master...vamshiaruru:typesense-go:master