Open vamshiaruru32 opened 1 year ago
The error is happening because this is the search response when an api call is made:
"group_key": [
5
]
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:
group_key:
type: array
items:
type: object
Can we change the type to string? To:
group_key:
type: array
items:
type: string
I've just published v0.8.0
which change the type of group_key
to array of string
. I've also added a test for this. Please check and confirm.
Hi @kishorenc I am still getting the same error:
json: cannot unmarshal number into Go struct field SearchGroupedHit.grouped_hits.group_key of type string
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 interface
type. I've pushed a commit for this: https://github.com/typesense/typesense-go/commit/24486a683104574d73c3ee0f070facb671052391
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