Multi Search
POST
/multi-search
Make multiple search queries in a single HTTP request.
The queries can span different indexes or lookup the results of different filters on the same index. Each query has its own results set.
Headers
-
Content-Type string Required
Payload content-type
Value is
application/json
.
POST /multi-search
curl \
-X POST https://example.meilisearch.com:7700/multi-search \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"queries":[{"indexUid":"movies","q":"Harry","offset":0,"limit":20,"filter":"(genres = Horror AND genres = Mystery) OR release_date \u003e 523242000","facets":["genres","author"],"attributesToRetrieve":["title","overview"],"attributesToCrop":["overview"],"cropLength":20,"attributesToHighlight":["overview"],"showMatchesPosition":true,"matchingStrategy":"all"}]}'
Request example
# Headers
Content-Type: application/json
# Payload
{
"queries": [
{
"indexUid": "movies",
"q": "Harry",
"offset": 0,
"limit": 20,
"filter": "(genres = Horror AND genres = Mystery) OR release_date > 523242000",
"facets": [
"genres",
"author"
],
"attributesToRetrieve": [
"title",
"overview"
],
"attributesToCrop": [
"overview"
],
"cropLength": 20,
"attributesToHighlight": [
"overview"
],
"showMatchesPosition": true,
"matchingStrategy": "all"
}
]
}
Response examples (200)
{
"results": [
{
"indexUid": "movies",
"hits": [
{
"id": 25684,
"title": "American Ninja 5",
"poster": "https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg",
"overview": "When a scientists daughter is kidnapped, American Ninja, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the ninja.",
"release_date": 725846400,
"_formatted": {
"id": 25684,
"title": "American Ninja 5",
"poster": "https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg",
"overview": "When a scientists daughter is kidnapped, American <em>Ninja</em>, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the <em>ninja</em>.",
"release_date": 725846400
},
"_matchesPosition": {
"overview": [
{
"start": 49,
"length": 5
},
{
"start": 155,
"length": 5
}
]
}
}
],
"limit": 0,
"offset": 0,
"estimatedTotalHits": 0,
"query": "string",
"processingTimeMs": 0
}
]
}
Response examples (401)
{
"message": "The Authorization header is missing. It must use the bearer authorization method.",
"code": "missing_authorization_header",
"type": "auth",
"link": "https://docs.meilisearch.com/errors#missing_authorization_header"
}