Enable Union Search
masterAvailable in typesense-instantsearch-adapter 2.10.0+ and Typesense Server v28.0+.
Union search merges results from multiple queries into a single ordered set. To enable it, set union: true when instantiating the adapter.
Requirements & Behavior:
- Pagination: Uses global pagination parameters only.
- Sorting: All search requests must share the same type, count, and sort field order.
- Merging: Results are combined into one final result set at the server level via Typesense's
multi_searchendpoint.
const typesenseInstantsearchAdapter = new TypesenseInstantSearchAdapter({
server: {
apiKey: "xyz",
nodes: [{ host: "localhost", port: "8108", path: "/", protocol: "http" }],
},
union: true, // Enables union search
collectionSpecificSearchParameters: {
products: { query_by: "name,description,categories" },
brands: { query_by: "name" },
},
});