Querying Typesense API with Array of Strings
TLDR Nikhilesh was struggling to query the typesense API with an array of strings. Kishore Nallan clarified the issue might be related to url encoding and further explained how to properly use the q
and filter_by
parameters.

Jul 06, 2023 (2 months ago)
Nikhilesh
04:49 AMI am facing a small issue while trying to query the typesense API with an array of strings
{{url}}/collections/{{collection_name}}/documents/search?q=[abc.com , abcd.com ]&query_by=server_name
The result contains only the records of the first server_name which is abc.com.
If I pass [abcd.com ,abc.com], the result contains the records of only abcd.com
Any ideas on what am I missing here?
Objective is to return the records from typesense collection for both abc.com and abcd.com
Thanks a lot :)
Kishore Nallan
10:02 AMmulti_search
end-point? It sends the request as a POST body so no url encoding is done.Kishore Nallan
10:03 AMq=[ , ]
Is not a valid syntax. The
q
must be just a string. It's filter_by where you can provide list of strings.Kishore Nallan
10:03 AM
Jul 17, 2023 (2 months ago)
Nikhilesh
04:34 AMTypesense
Indexed 2764 threads (79% resolved)
Similar Threads
Usage and Modification of Dynamic Routes in Typesense Documents
Ethan needed a way to perform exact queries through two fields in Typesense documents. Kishore Nallan demonstrated its possibility using the "filter_by". An issue was resolved via recommending that fields in 'query by' should be a string type.
Querying and Indexing Multiple Elements Issues
Krish queried fields with multiple elements, which Kishore Nallan suggested checking `drop_tokens_threshold`. Krish wished to force OR mode for token, but Kishore Nallan admitted the feature was missing. Krish was able to resolve the issue with url encoding.
Sorting Results in Typesense and Handling Errors
Ramees asks about sorting results by distance in Typesense, entering a list of strings as a field, and resolving an error with `fields` format. Kishore Nallan assists with these issues and advises on storing timestamps and proper authentication.
