mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 12:05:05 +08:00
Merge #182
182: remove facet setting r=MarinPostma a=MarinPostma remove useless code Co-authored-by: Marin Postma <postma.marin@protonmail.com>
This commit is contained in:
commit
998d5ead34
@ -196,29 +196,6 @@ impl Index {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_facets(
|
|
||||||
&self,
|
|
||||||
levels: &Facets,
|
|
||||||
update_builder: UpdateBuilder,
|
|
||||||
) -> anyhow::Result<UpdateResult> {
|
|
||||||
// We must use the write transaction of the update here.
|
|
||||||
let mut wtxn = self.write_txn()?;
|
|
||||||
let mut builder = update_builder.facets(&mut wtxn, self);
|
|
||||||
if let Some(value) = levels.level_group_size {
|
|
||||||
builder.level_group_size(value);
|
|
||||||
}
|
|
||||||
if let Some(value) = levels.min_level_size {
|
|
||||||
builder.min_level_size(value);
|
|
||||||
}
|
|
||||||
match builder.execute() {
|
|
||||||
Ok(()) => wtxn
|
|
||||||
.commit()
|
|
||||||
.and(Ok(UpdateResult::Other))
|
|
||||||
.map_err(Into::into),
|
|
||||||
Err(e) => Err(e),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn delete_documents(
|
pub fn delete_documents(
|
||||||
&self,
|
&self,
|
||||||
document_ids: Option<impl io::Read>,
|
document_ids: Option<impl io::Read>,
|
||||||
|
@ -83,7 +83,6 @@ impl UpdateHandler {
|
|||||||
ClearDocuments => index.clear_documents(update_builder),
|
ClearDocuments => index.clear_documents(update_builder),
|
||||||
DeleteDocuments => index.delete_documents(content, update_builder),
|
DeleteDocuments => index.delete_documents(content, update_builder),
|
||||||
Settings(settings) => index.update_settings(settings, update_builder),
|
Settings(settings) => index.update_settings(settings, update_builder),
|
||||||
Facets(levels) => index.update_facets(levels, update_builder),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
match result {
|
match result {
|
||||||
|
@ -4,7 +4,7 @@ use chrono::{DateTime, Utc};
|
|||||||
use milli::update::{DocumentAdditionResult, IndexDocumentsMethod, UpdateFormat};
|
use milli::update::{DocumentAdditionResult, IndexDocumentsMethod, UpdateFormat};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::index::{Facets, Settings};
|
use crate::index::Settings;
|
||||||
|
|
||||||
pub type UpdateError = String;
|
pub type UpdateError = String;
|
||||||
|
|
||||||
@ -26,7 +26,6 @@ pub enum UpdateMeta {
|
|||||||
ClearDocuments,
|
ClearDocuments,
|
||||||
DeleteDocuments,
|
DeleteDocuments,
|
||||||
Settings(Settings),
|
Settings(Settings),
|
||||||
Facets(Facets),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
Loading…
Reference in New Issue
Block a user