mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +08:00
update settings
This commit is contained in:
parent
8432c8584a
commit
47138c7632
@ -25,13 +25,11 @@ impl Data {
|
|||||||
|
|
||||||
pub async fn update_settings(
|
pub async fn update_settings(
|
||||||
&self,
|
&self,
|
||||||
_index: impl AsRef<str> + Send + Sync + 'static,
|
index: String,
|
||||||
_settings: Settings
|
settings: Settings
|
||||||
) -> anyhow::Result<UpdateStatus> {
|
) -> anyhow::Result<UpdateStatus> {
|
||||||
todo!()
|
let update = self.index_controller.update_settings(index, settings).await?;
|
||||||
//let index_controller = self.index_controller.clone();
|
Ok(update.into())
|
||||||
//let update = tokio::task::spawn_blocking(move || index_controller.update_settings(index, settings)).await??;
|
|
||||||
//Ok(update.into())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn clear_documents(
|
pub async fn clear_documents(
|
||||||
|
@ -114,8 +114,14 @@ impl IndexController {
|
|||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_settings(&self, index_uid: String, settings: Settings) -> anyhow::Result<UpdateStatus> {
|
pub async fn update_settings(&self, index_uid: String, settings: Settings) -> anyhow::Result<UpdateStatus> {
|
||||||
todo!()
|
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> {
|
pub async fn create_index(&self, index_settings: IndexSettings) -> anyhow::Result<IndexMetadata> {
|
||||||
|
Loading…
Reference in New Issue
Block a user