Hey folks! I'm trying to limit the max time to res...
# community-help
d
Hey folks! I'm trying to limit the max time to response with the
search_cutoff_ms
but it does not seem to have any effect. More details on thread.
The collection schema is something like:
Copy code
{
  "name": "travelers",
  "fields": [
    {
      "name": "_id",
      "type": "string",
      "index": true,
      "optional": false
    },
    {
      "name": "first_name",
      "type": "string",
      "index": true,
      "optional": false
    },
    {
      "name": "last_name",
      "type": "string",
      "index": true,
      "optional": false
    },
    {
      "name": "email_address",
      "type": "string",
      "index": true,
      "optional": false
    },
    {
      "name": "employee_id",
      "type": "string",
      "index": true,
      "optional": true
    },
    {
      "name": "company_id",
      "type": "string",
      "index": true,
      "optional": true
    },
    {
      "name": "company_group_id",
      "type": "string",
      "index": true,
      "optional": true
    }
  ],
  "num_documents": 3685055,
  "token_separators": [
    "-"
  ]
}
An example of a typical request is:
Copy code
GET /collections/travelers/documents/search?q=johnson
  &query_by=_id,first_name,last_name,email_address,employee_id
  &filter_by=company_group_id:=803f6614-a459-3c92-9375-fffeeeaa
  &highlight_fields=none
  &per_page=250
  &max_candidates=4
  &use_cache=false
  &search_cutoff_ms=1000
And the response, where
search_cutoff
was not applied and the search time is too high to be acceptable in our use case:
Copy code
{
    "facet_counts":[],
    "found":803,
    "hits":[
    ...
    ],
    "out_of":3685109,
    "page":1,
    "request_params":{
      "collection_name":"travelers",
      "first_q":"johnson",
      "per_page":250,
      "q":"johnson"
    },
    "search_cutoff":false,
    "search_time_ms":4063
  }
I know that cutoff is not guaranteed, but I've tried different parameters, different values, and cutoff was not applied. That particular CompanyGroupId is one of the bigger ones, with around 100K travelers. Typesense version is
0.25.2
. Is there something I'm not considering? Any help is appreciated! Thanks!
h
Try upgrading to v26. We have improved the filtering performance and
search_cutoff
is also made more reliable.
d
I'll try v26 then. thank you!