Hi Typesensible people. I'm getting an error 414 ...
# community-help
l
Hi Typesensible people. I'm getting an error 414 when trying to filter on a large list of values. I'm guessing this is the api request being too long . Is there a way I can avoid this error? (btw. my query works fine if i reduce the number of items in the 'boat_id' list) example query
Copy code
{'q': '',
 'query_by': 'location_name,location_names,operator_name,model_name,manufacturer_raw,name',
 'group_by': 'boat_id',
 'group_limit': 1,
 'sort_by': 'display_rank:desc',
 'exclude_fields': 'possible_start_dates',
 'facet_by': 'location_id,loc0,loc1,loc2,loc3,loc4,loc5,base_price_band,base_price_euro,pd_int,boat_type_choice_id,boat_type_name,operator_name,manufacturer_raw,model_name,key_equipment,length_feet,build_year,min_dur,captained,self_drive,crewed_only,bathrooms,berths,cabins,mainsail_type,genoa_type,feed,display_rank',
 'max_facet_values': 50,
 'per_page': 20,
 'filter_by': 'possible_start_dates:=[2025-05-01]&&min_dur:[>=50400,0]&&boat_id:[41827,41831,41832,41833,41834,41838,41840,41844,41846,41848 ..........a very long list of 1000's elements]',
 'page': 1}
k
We don't return any 414 status code in our code. Are you sure it's 414?
l
I'm getting. [Errno 414] API error.
k
Can you post the full stack trace or screenshot? I just checked and we don't have a 414 reference anywhere in the code.
l
The typesense server is proxied by nginx so it might be an nginx error . is it possible to send me request ad POST'ed values rather than GET query parameters ?
I'm using the typesense-python client which is making the GET request
f
Can you try it with curl instead?
l
Yes I could , but can I POST to the search endpoint of the typesense server ?
f
To the Typesense node directly you mean? If so then yes. Mind you, if you want to use POST, it has to be the
multisearch
endpoint. https://typesense.org/docs/27.1/api/federated-multi-search.html
l
currently in python code I have
Copy code
search_client = typesense.Client({
    "nodes": [{
        "host": settings.TYPESENSE_HOST,  # For Typesense Cloud use <http://xxx.a1.typesense.net|xxx.a1.typesense.net>
        "port": settings.TYPESENSE_PORT,  # For Typesense Cloud use 443
        "protocol": settings.TYPESENSE_PROTOCOL,  # For Typesense Cloud use https
    }],
    "api_key": settings.TYPESENSE_SEARCH_ONLY_API_KEY,
    "connection_timeout_seconds": settings.TYPESENSE_SEARCH_TIMEOUT_SECONDS,
})
collection = search_client.collections[settings.TYPESENSE_SEARCH_COLLECTION_NAME]
resp = collection.documents.search(search_params)
collection.documents.search is making the GET request . yes if i use the multisearch then it would use POST
f
This seems like an nginx issue
l
Yes and your suggestion of the multisearch might be a workaround for the issue -- thanks for the idea
🙌 1