Support target index names in the support route
#6049 opened on Dec 11, 2025
Description
We recently introduced the export route, which is very useful for exporting documents between instances. However, there is one missing feature that could be useful in practice: the support for target index names. This feature would allow using a defined name for each exported index.
This way we would be able to:
- Merge indexes into a single one,
- Target the same instance but into indexes with different names and settings,
- Create indexes dedicated to specific time ranges (using filters and names).
The API I would like to see resembles the following. It would be possible to use the special $name variable to construct target index names dynamically. If the $name variable is not present, the index name would be static and corresponds precisely to the provided value (raw). Users can also omit the name field, and it will use the original index name, the current and default behavior.
I am still asking myself a question: Should we introduce the $name variable that results in the whole index name, or rather a $pattern one that only corresponds to what the * matches. I still think the second option would be more challenging to work with and prone to more errors; a missing * can result in an empty string, while the $name will always correspond to a valid index name.
// POST /export
{
"url": "http://ms-xxx-yy.fra.meilisearch.com",
"indexes": {
"super-*": { // matches "super-toto" and "super-boby"
"name": "mega-$name", // will result in "mega-super-toto" and "mega-super-boby"
"filter": "super-power = laser"
}
}
}
// POST /export
{
"url": "http://ms-xxx-yy.fra.meilisearch.com",
"indexes": {
"super-*": { // matches "super-toto", "super-boby"
"name": "everyone", // no pattern so results in "everyone"
"filter": "super-power = laser"
}
}
}