list settings

This commit is contained in:
mpostma 2021-03-04 12:38:55 +01:00
parent 47138c7632
commit 17b84691f2
No known key found for this signature in database
GPG key ID: CBC8A7C1D7A28C3A
5 changed files with 70 additions and 47 deletions

View file

@ -7,14 +7,15 @@ mod update_handler;
use std::path::Path;
use tokio::sync::{mpsc, oneshot};
use futures::stream::StreamExt;
use actix_web::web::Payload;
use crate::index::{SearchResult, SearchQuery};
use actix_web::web::Bytes;
use actix_web::web::Payload;
use anyhow::Context;
use chrono::{DateTime, Utc};
use crate::index::{SearchResult, SearchQuery};
use futures::stream::StreamExt;
use milli::update::{IndexDocumentsMethod, UpdateFormat};
use serde::{Serialize, Deserialize};
use tokio::sync::{mpsc, oneshot};
use uuid::Uuid;
pub use updates::{Processed, Processing, Failed};
@ -135,14 +136,6 @@ impl IndexController {
todo!()
}
fn swap_indices(&self, index1_uid: String, index2_uid: String) -> anyhow::Result<()> {
todo!()
}
pub fn index(&self, name: String) -> anyhow::Result<Option<std::sync::Arc<milli::Index>>> {
todo!()
}
fn update_status(&self, index: String, id: u64) -> anyhow::Result<Option<UpdateStatus>> {
todo!()
}
@ -155,6 +148,15 @@ impl IndexController {
todo!()
}
pub async fn settings(&self, index: String) -> anyhow::Result<Settings> {
let uuid = self.uuid_resolver
.resolve(index.clone())
.await?
.with_context(|| format!("Index {:?} doesn't exist", index))?;
let settings = self.index_handle.settings(uuid).await?;
Ok(settings)
}
fn update_index(&self, name: String, index_settings: IndexSettings) -> anyhow::Result<IndexMetadata> {
todo!()
}