-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to make search query with group by, with the error: json: cannot unmarshal number into Go struct field SearchGroupedHit.grouped_hits.group_key of type map[string]interface {} #141
Comments
The error is happening because this is the search response when an api call is made:
But the type is defined as GroupKey []map[string]interface{} It should instead be GroupKey []interface{} I have created a fork with that change and used that to test things, it works. However, I don't know if that is the right solution, buecase every code gen will override that change. |
I faced the same issue. @kishorenc Could you please take a look? |
Will be looking into it this week. |
@kishorenc As a quick workaround, on line https://github.com/typesense/typesense-api-spec/blob/0768c9f88dafc35b45ba8b4e888bd894ade8d208/openapi.yml#L1448 From:
Can we change the type to string?
|
I've just published |
Hi @kishorenc I am still getting the same error:
This time because the type for GroupKey is defined as []string, where as I am using an int field. But I haven't seen in documentation that group by has to be a string. so, is this a bug in the go sdk or is it a miss in the documentation? Can you verify please? |
I finally figured out how to make openai generator spit out Can you please try with this SHA and let me know if it works? If it does, I will create a new release. |
Hi @kishorenc , thanks for the fix. It is working fine with your commit. |
Description
When I make a search query with group by, I get the error
Steps to reproduce
And here's the schema
Expected Behavior
No error
Actual Behavior
Unmarshal error
Metadata
Typesense Version: 0.24.1
OS: Ubuntu 22.04
The text was updated successfully, but these errors were encountered: