This message was deleted.
# community-help
s
This message was deleted.
k
Please post the collection schema and the query used.
@Md.Riad Hasan Sarker Once you post the collection schema and search query, I can write a test for it in Go client for this and check.
m
Copy code
//collection schema  
 {
      "facet": false,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "title",
      "optional": false,
      "sort": false,
      "type": "string"
},  
 {
      "facet": false,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "order_idx",
      "optional": true,
      "sort": true,
      "type": "int32"
},
{
      "facet": true,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "taxonomy.verticals",
      "optional": true,
      "sort": false,
      "type": "string[]"
    },
    {
      "facet": true,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "taxonomy.segments",
      "optional": true,
      "sort": false,
      "type": "string[]"
    }
//search query
q: 
query_by: title
sort_by: order_idx:desc
group_by: taxonomy.segments
group_limit: 4
page: 1
k
Is this a schema with nested objects?
Can you post a sample document with those values?
m
Copy code
//sample documents
[
   {
      "title":"spoken english",
      "order_idx":1,
      "taxonomy.verticals":[
         "skills"
      ],
      "taxonomy.segments":[
         "language_learning",
         "skills_development"
      ]
   },
   {
      "title":"ielts",
      "order_idx":2,
      "taxonomy.verticals":[
         "skills"
      ],
      "taxonomy.segments":[
         "language_learning",
         "free",
         "career"
      ]
   }
]
i tried on nested object and direct string[] field. Both working on raw query . But not in go client. Go client just work on group_by on string not on string[] field.
k
Here is a test that I wrote that works. I am using a string array field. can you produce a similar code snippet that creates a collection, indexes a document and queries it that shows the error? https://gist.github.com/kishorenc/cb6f6061ac2d688d67772448c42c2433
Also what version of the Go client are you using?
m
i tried your code snippet just now. But got same error.
github.com/typesense/typesense-go v0.8.0
Copy code
json: cannot unmarshal array into Go struct field SearchGroupedHit.grouped_hits.group_key of type string
Copy code
result, err := TypesenseClient.Collection(collectionName).Documents().Search(searchParams)
	if err != nil {
		fmt.Println("error", err) // here i got the error
	}
k
Try with
v0.9.0
that I just published.
m
now its working . A big thanks
🙌 1