typesense-go icon indicating copy to clipboard operation
typesense-go copied to clipboard

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

Open vamshiaruru opened this issue 2 years ago • 1 comments

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 avatar Sep 15 '23 07:09 vamshiaruru

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

vamshiaruru avatar Sep 15 '23 08:09 vamshiaruru

I just ran into this and it's very annoying, especially since multi-search is our only way to actually search while circumventing the 4000 char limit of the regular search. We now basically have no error reporting on any of our search calls.

advdv avatar Jan 24 '25 08:01 advdv