Endpoint
Executes multiple search queries across different collections in a single request. This is more efficient than making separate search requests and ensures consistency across results.
Request Body
The request body should contain an object with a searches array.
Array of search objects, each representing an individual search query The collection to search. Supported values:
ledgers
balances
transactions
identities
reconciliations
The search query. Use * to match all documents
Comma-separated list of fields to search in
Filter conditions to narrow down results
Number of results per page
Response
Array of search results, one for each search in the request Total number of documents matching this search
Array of matching documents
Facet counts if requested
Example Request
Search Across Multiple Collections
{
"searches" : [
{
"collection" : "transactions" ,
"q" : "*" ,
"filter_by" : "status:completed && currency:USD" ,
"sort_by" : "created_at:desc" ,
"per_page" : 10
},
{
"collection" : "balances" ,
"q" : "*" ,
"filter_by" : "currency:USD" ,
"sort_by" : "balance:desc" ,
"per_page" : 5
},
{
"collection" : "identities" ,
"q" : "john" ,
"query_by" : "first_name,last_name,email_address" ,
"per_page" : 10
}
]
}
Dashboard Overview Query
{
"searches" : [
{
"collection" : "transactions" ,
"q" : "*" ,
"filter_by" : "created_at:>1709467200" ,
"facet_by" : "status,currency" ,
"per_page" : 1
},
{
"collection" : "balances" ,
"q" : "*" ,
"facet_by" : "currency" ,
"per_page" : 1
},
{
"collection" : "reconciliations" ,
"q" : "*" ,
"filter_by" : "status:in_progress" ,
"per_page" : 5
}
]
}
Example Response
{
"results" : [
{
"found" : 142 ,
"hits" : [
{
"document" : {
"transaction_id" : "txn_123abc" ,
"amount" : 100.50 ,
"currency" : "USD" ,
"status" : "completed" ,
"created_at" : 1709553600
}
}
],
"page" : 1 ,
"out_of" : 15
},
{
"found" : 89 ,
"hits" : [
{
"document" : {
"balance_id" : "bln_456def" ,
"balance" : "10000.00" ,
"currency" : "USD" ,
"created_at" : 1709467200
}
}
],
"page" : 1 ,
"out_of" : 18
},
{
"found" : 12 ,
"hits" : [
{
"document" : {
"identity_id" : "idt_789ghi" ,
"first_name" : "John" ,
"last_name" : "Doe" ,
"email_address" : "john.doe@example.com"
}
}
],
"page" : 1 ,
"out_of" : 2
}
]
}
Use Cases
Dashboard Data Loading
Load multiple widgets’ data in a single request:
{
"searches" : [
{
"collection" : "transactions" ,
"q" : "*" ,
"filter_by" : "created_at:>1709467200" ,
"per_page" : 5
},
{
"collection" : "balances" ,
"q" : "*" ,
"sort_by" : "balance:desc" ,
"per_page" : 5
}
]
}
Fetch related data across collections:
{
"searches" : [
{
"collection" : "transactions" ,
"q" : "*" ,
"filter_by" : "source:bln_123abc" ,
"per_page" : 20
},
{
"collection" : "balances" ,
"q" : "*" ,
"filter_by" : "balance_id:bln_123abc" ,
"per_page" : 1
}
]
}
Aggregated Statistics
Get counts and statistics from multiple collections:
{
"searches" : [
{
"collection" : "transactions" ,
"q" : "*" ,
"facet_by" : "status,currency" ,
"per_page" : 0
},
{
"collection" : "balances" ,
"q" : "*" ,
"facet_by" : "currency" ,
"per_page" : 0
}
]
}
Error Responses
Error message describing what went wrong
Common Errors
400 Bad Request : Invalid request body or search parameters
500 Internal Server Error : Search service error
Benefits of Multi-Search
Performance : Single HTTP request instead of multiple
Consistency : All searches execute at the same point in time
Efficiency : Reduced network overhead and latency
Simplicity : Easier to manage in client code
Best Practices
Limit searches : Don’t include more than 5-10 searches in a single request
Use appropriate per_page : Smaller values for better performance
Combine with caching : Cache multi-search results for frequently accessed data
Error handling : Each search result is independent; one failure doesn’t affect others