mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-24 05:30:16 +01:00
update settings
This commit is contained in:
parent
8432c8584a
commit
47138c7632
@ -25,13 +25,11 @@ impl Data {
|
||||
|
||||
pub async fn update_settings(
|
||||
&self,
|
||||
_index: impl AsRef<str> + Send + Sync + 'static,
|
||||
_settings: Settings
|
||||
index: String,
|
||||
settings: Settings
|
||||
) -> anyhow::Result<UpdateStatus> {
|
||||
todo!()
|
||||
//let index_controller = self.index_controller.clone();
|
||||
//let update = tokio::task::spawn_blocking(move || index_controller.update_settings(index, settings)).await??;
|
||||
//Ok(update.into())
|
||||
let update = self.index_controller.update_settings(index, settings).await?;
|
||||
Ok(update.into())
|
||||
}
|
||||
|
||||
pub async fn clear_documents(
|
||||
|
@ -114,8 +114,14 @@ impl IndexController {
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn update_settings(&self, index_uid: String, settings: Settings) -> anyhow::Result<UpdateStatus> {
|
||||
todo!()
|
||||
pub async fn update_settings(&self, index_uid: String, settings: Settings) -> anyhow::Result<UpdateStatus> {
|
||||
let uuid = self.uuid_resolver.get_or_create(index_uid).await?;
|
||||
let meta = UpdateMeta::Settings(settings);
|
||||
// Nothing so send, drop the sender right away, as not to block the update actor.
|
||||
let (_, receiver) = mpsc::channel(1);
|
||||
|
||||
let status = self.update_handle.update(meta, receiver, uuid).await?;
|
||||
Ok(status)
|
||||
}
|
||||
|
||||
pub async fn create_index(&self, index_settings: IndexSettings) -> anyhow::Result<IndexMetadata> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user