HI I am using this group by query for our filters...
# community-help
m
HI I am using this group by query for our filters
Copy code
curl --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.
Copy code
{
  "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
Copy code
{
  "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
}