Manav Kothari
11/12/2024, 6:32 AMcurl --location --request GET '{{URL}}/collections/job_title/documents/search/?highlight_fields=none&page=1&per_page=20&q=developer&query_by=job_title&sort_by=count:desc&group_by=job_title: desc&prioritize_exact_match=true' \
--header 'X-TYPESENSE-API-KEY: {{KEY}}'
but I am getting this error, any idea what I am missing here.
{
"message": "Could not find a field named `count` in the schema for sorting."
}
cause if I remove the sort by field I get this response
{
"facet_counts": [],
"found": 134530,
"found_docs": 134530,
"grouped_hits": [
{
"found": 1,
"group_key": [
"Developers"
],
"hits": [
{
"document": {
"count": 31,
"id": "2832562",
"job_title": "Developers"
},
"highlight": {},
"highlights": [],
"text_match": 578730123365712000,
"text_match_info": {
"best_field_score": "1108091339008",
"best_field_weight": 15,
"fields_matched": 1,
"num_tokens_dropped": 0,
"score": "578730123365711993",
"tokens_matched": 1,
"typo_prefix_score": 0
}
}
]
},
{
"found": 1,
"group_key": [
"Develop"
],
"hits": [
{
"document": {
"count": 31,
"id": "2831688",
"job_title": "Develop"
},
"highlight": {},
"highlights": [],
"text_match": 578730123365712000,
"text_match_info": {
"best_field_score": "1108091339008",
"best_field_weight": 15,
"fields_matched": 1,
"num_tokens_dropped": 0,
"score": "578730123365711993",
"tokens_matched": 1,
"typo_prefix_score": 0
}
}
]
}
],
"out_of": 4258692,
"page": 1,
"request_params": {
"collection_name": "job_title",
"first_q": "developer",
"per_page": 20,
"q": "developer"
},
"search_cutoff": false,
"search_time_ms": 309
}