setttings update

This commit is contained in:
mpostma 2021-01-28 16:57:53 +01:00
parent 8183202868
commit 4119ae8655
No known key found for this signature in database
GPG Key ID: CBC8A7C1D7A28C3A
2 changed files with 6 additions and 7 deletions

View File

@ -48,10 +48,13 @@ impl IndexController for LocalIndexController {
fn update_settings<S: AsRef<str>>( fn update_settings<S: AsRef<str>>(
&self, &self,
_index_uid: S, index: S,
_settings: super::Settings settings: super::Settings
) -> anyhow::Result<UpdateStatus<UpdateMeta, UpdateResult, String>> { ) -> anyhow::Result<UpdateStatus<UpdateMeta, UpdateResult, String>> {
todo!() let (_, update_store) = self.indexes.get_or_create_index(&index, self.update_db_size, self.index_db_size)?;
let meta = UpdateMeta::Settings(settings);
let pending = update_store.register_update(meta, &[]).unwrap();
Ok(pending.into())
} }
fn create_index<S: AsRef<str>>(&self, _index_uid: S) -> anyhow::Result<()> { fn create_index<S: AsRef<str>>(&self, _index_uid: S) -> anyhow::Result<()> {

View File

@ -188,8 +188,6 @@ impl HandleUpdate<UpdateMeta, UpdateResult, String> for UpdateHandler {
) -> Result<Processed<UpdateMeta, UpdateResult>, Failed<UpdateMeta, String>> { ) -> Result<Processed<UpdateMeta, UpdateResult>, Failed<UpdateMeta, String>> {
use UpdateMeta::*; use UpdateMeta::*;
println!("handling update {}", update_id);
let update_builder = self.update_buidler(update_id); let update_builder = self.update_buidler(update_id);
let result = match meta.meta() { let result = match meta.meta() {
@ -199,8 +197,6 @@ impl HandleUpdate<UpdateMeta, UpdateResult, String> for UpdateHandler {
Facets(levels) => self.update_facets(levels, update_builder), Facets(levels) => self.update_facets(levels, update_builder),
}; };
println!("{:?}", result);
match result { match result {
Ok(result) => Ok(meta.process(result)), Ok(result) => Ok(meta.process(result)),
Err(e) => Err(meta.fail(e.to_string())), Err(e) => Err(meta.fail(e.to_string())),