mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
documetn addition and search
This commit is contained in:
parent
74410d8c6b
commit
8183202868
6 changed files with 79 additions and 36 deletions
|
@ -1,5 +1,5 @@
|
|||
mod local_index_controller;
|
||||
mod updates;
|
||||
pub mod updates;
|
||||
|
||||
pub use local_index_controller::LocalIndexController;
|
||||
|
||||
|
@ -12,9 +12,8 @@ use milli::Index;
|
|||
use milli::update::{IndexDocumentsMethod, UpdateFormat, DocumentAdditionResult};
|
||||
use serde::{Serialize, Deserialize, de::Deserializer};
|
||||
|
||||
use updates::{Processed, Processing, Failed, Pending, Aborted};
|
||||
use updates::{Processed, Processing, Failed, UpdateStatus};
|
||||
|
||||
pub type UpdateStatusResponse = UpdateStatus<UpdateMeta, UpdateResult, String>;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(tag = "type")]
|
||||
|
@ -33,15 +32,6 @@ pub struct Facets {
|
|||
pub min_level_size: Option<NonZeroUsize>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum UpdateStatus<M, P, N> {
|
||||
Pending { update_id: u64, meta: Pending<M> },
|
||||
Progressing { update_id: u64, meta: P },
|
||||
Processed { update_id: u64, meta: Processed<M, N> },
|
||||
Aborted { update_id: u64, meta: Aborted<M> },
|
||||
}
|
||||
|
||||
fn deserialize_some<'de, T, D>(deserializer: D) -> Result<Option<T>, D::Error>
|
||||
where T: Deserialize<'de>,
|
||||
D: Deserializer<'de>
|
||||
|
@ -116,11 +106,11 @@ pub trait IndexController {
|
|||
method: IndexDocumentsMethod,
|
||||
format: UpdateFormat,
|
||||
data: &[u8],
|
||||
) -> anyhow::Result<UpdateStatusResponse>;
|
||||
) -> anyhow::Result<UpdateStatus<UpdateMeta, UpdateResult, String>>;
|
||||
|
||||
/// Updates an index settings. If the index does not exist, it will be created when the update
|
||||
/// is applied to the index.
|
||||
fn update_settings<S: AsRef<str>>(&self, index_uid: S, settings: Settings) -> anyhow::Result<UpdateStatusResponse>;
|
||||
fn update_settings<S: AsRef<str>>(&self, index_uid: S, settings: Settings) -> anyhow::Result<UpdateStatus<UpdateMeta, UpdateResult, String>>;
|
||||
|
||||
/// Create an index with the given `index_uid`.
|
||||
fn create_index<S: AsRef<str>>(&self, index_uid: S) -> Result<()>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue