-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Introduce a new route to export indexes #5670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hello, I'm a bot 🤖You are receiving this message because you declared that this PR make changes to the Meilisearch database. Thank you for contributing to Meilisearch ❤️ This PR makes forward-compatible changesForward-compatible changes are changes to the database such that databases created in an older version of Meilisearch are still valid in the new version of Meilisearch. They usually represent additive changes, like adding a new optional attribute or setting.
This PR makes breaking changesBreaking changes are changes to the database such that databases created in an older version of Meilisearch need changes to remain valid in the new version of Meilisearch. This typically happens when the way to store the data changed (change of database, new required key, etc). This can also happen due to breaking changes in the API of an experimental feature.
|
a7685fe
to
4ce1621
Compare
3335525
to
a743da3
Compare
d21c1fc
to
6303121
Compare
1bb7abb
to
0f1dd36
Compare
445b8e1
to
7219299
Compare
ExporingTheSettings, | ||
ExporingTheDocuments, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo
ExporingTheSettings, | |
ExporingTheDocuments, | |
ExportingTheSettings, | |
ExportingTheDocuments, |
// 3. we batch the export. | ||
let to_export = self.queue.tasks.get_kind(rtxn, Kind::Export)? & enqueued; | ||
if !to_export.is_empty() { | ||
let task_id = to_export.iter().next().expect("There must be only one export task"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let task_id = to_export.iter().next().expect("There must be only one export task"); | |
let task_id = to_export.iter().next().expect("There must be at least one export task"); |
tag = "Export", | ||
security(("Bearer" = ["export", "*"])), | ||
responses( | ||
(status = OK, description = "Known nodes are returned", body = Export, content_type = "application/json", example = json!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(status = OK, description = "Known nodes are returned", body = Export, content_type = "application/json", example = json!( | |
(status = 202, description = "Export successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( |
// TODO make it experimental? | ||
// index_scheduler.features().check_network("Using the /network route")?; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO make it experimental? | |
// index_scheduler.features().check_network("Using the /network route")?; |
request.send_string("").map_err(into_backoff_error) | ||
})?; | ||
let already_existed = response.status() == 200; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
request.send_string("").map_err(into_backoff_error) | |
})?; | |
let already_existed = response.status() == 200; | |
request.send_bytes(Default::default()).map_err(into_backoff_error) | |
})?; | |
let index_exists = response.status() == 200; |
indexes: BTreeMap<IndexUidPattern, DetailsExportIndexSettings>, | ||
indexes: BTreeMap<String, DetailsExportIndexSettings>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, can we keep the index UID pattern, here, please?
indexes: indexes.iter().map(|(p, s)| (p.clone(), s.clone().into())).collect(), | ||
indexes: BTreeMap::new(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep this.
indexes: indexes.iter().map(|(p, s)| (p.clone(), s.clone().into())).collect(), | ||
indexes: BTreeMap::new(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep this.
indexes: indexes.iter().map(|(p, s)| (p.clone(), s.clone().into())).collect(), | ||
indexes: BTreeMap::new(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And keep this.
@@ -127,7 +157,7 @@ impl IndexScheduler { | |||
progress.update_progress(progress_step); | |||
|
|||
output.insert( | |||
(*pattern).clone(), | |||
uid.clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We just need to convert the uid into an IndexUidPattern
, here.
@@ -30,7 +30,7 @@ impl IndexScheduler { | |||
payload_size: Option<&Byte>, | |||
indexes: &BTreeMap<IndexUidPattern, ExportIndexSettings>, | |||
progress: Progress, | |||
) -> Result<BTreeMap<IndexUidPattern, DetailsExportIndexSettings>> { | |||
) -> Result<BTreeMap<String, DetailsExportIndexSettings>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep this IndexUidPattern
, please.
This PR introduces a new route to export/transfer indexes and documents to another Meilisearch instance. This PR is linked to this one on the Mini-Dashboard meilisearch/mini-dashboard#622.
Fixes #5713
To Do
"*"
Disable it via an experimental featureoverrideSettings
parameterThis PR makes forward-compatible changes
Forward-compatible changes are changes to the database such that databases created in an older version of Meilisearch are still valid in the new version of Meilisearch. They usually represent additive changes, like adding a new optional attribute or setting.
We introduce a new
Export
task in the task queue. There are no settings, experimental flags, or anything but a new task type.I opened a database generated with Meilisearch from the main branch and opened it with a database generated with Meilisearch from this branch. Once opened, I called the export route to export documents to another Meilisearch.