Hi Team, I have a collection containing over 100,0...
# community-help
a
Hi Team, I have a collection containing over 100,000 documents, and I need to perform a search query to retrieve results from a specific subset of these documents. Previously, I used the
filter_by: sku:[arrayOfSKUs]
approach, which worked well when the search query included around 100 SKUs. However, when the number of SKUs increased to 300+, I encountered the following error: "Server said: Query string exceeds max allowed length of 4000. Use the /multi_search endpoint for larger payloads." Is there a way to increase the maximum allowed query length? Alternatively, could you suggest a better approach or workaround for this?
1
k
As the error message says, you have to use the
/multi_search
API which uses POST and which does not have this restriction.
a
Is there any way to increase the max length?
k
No
a
Okay
Thanks a lot, Kishore! I really appreciate your prompt support.🙌
🙌 1
What about sorting? As per the docs:
The results array in a multi_search response is guaranteed to be in the same order as the queries you send in the searches array in your request.
How can I combine the hits from multiple searches and produce a single, sorted result?
k
Latest v28 RC builds support union: https://github.com/typesense/typesense/pull/2051
a
Thanks for sharing the update. Does Multi search support vector query?
My apologies for the confusion earlier—it was an error in my code. Multi-search does indeed support vector queries. 😊
In the GitHub documentation, it is mentioned: "`sort_by` with union requires all the searches to have the same type and number of fields and sorting order to work." I wanted to clarify: if my collections have different fields, but I am using
include_fields
to ensure that only the fields present in all queried collections are included, will the union operation still work in this case?
k
yeah should be fine