Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Remove facet setting #182

Merged
merged 1 commit into from
May 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions meilisearch-http/src/index/updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
&self,
document_ids: Option<impl io::Read>,
Expand Down
1 change: 0 additions & 1 deletion meilisearch-http/src/index_controller/update_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ impl UpdateHandler {
ClearDocuments => index.clear_documents(update_builder),
DeleteDocuments => index.delete_documents(content, update_builder),
Settings(settings) => index.update_settings(settings, update_builder),
Facets(levels) => index.update_facets(levels, update_builder),
};

match result {
Expand Down
3 changes: 1 addition & 2 deletions meilisearch-http/src/index_controller/updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use chrono::{DateTime, Utc};
use milli::update::{DocumentAdditionResult, IndexDocumentsMethod, UpdateFormat};
use serde::{Deserialize, Serialize};

use crate::index::{Facets, Settings};
use crate::index::Settings;

pub type UpdateError = String;

Expand All @@ -26,7 +26,6 @@ pub enum UpdateMeta {
ClearDocuments,
DeleteDocuments,
Settings(Settings),
Facets(Facets),
}

#[derive(Debug, Serialize, Deserialize, Clone)]
Expand Down