meilisearch/src/index_controller/mod.rs

44 lines
1.0 KiB
Rust
Raw Normal View History

2021-02-26 16:10:04 +08:00
pub mod actor_index_controller;
2021-02-02 02:51:47 +08:00
mod updates;
2021-01-14 00:50:36 +08:00
2021-02-04 00:44:20 +08:00
use chrono::{DateTime, Utc};
2021-03-04 18:56:32 +08:00
use milli::update::{IndexDocumentsMethod, UpdateFormat};
use serde::{Serialize, Deserialize};
2021-02-09 23:08:13 +08:00
use uuid::Uuid;
2021-02-02 02:51:47 +08:00
pub use updates::{Processed, Processing, Failed};
2021-03-04 18:56:32 +08:00
use crate::index::{UpdateResult, Settings, Facets};
2021-02-02 02:51:47 +08:00
pub type UpdateStatus = updates::UpdateStatus<UpdateMeta, UpdateResult, String>;
2021-01-28 21:12:34 +08:00
2021-02-04 00:44:20 +08:00
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct IndexMetadata {
uuid: Uuid,
created_at: DateTime<Utc>,
updated_at: DateTime<Utc>,
2021-02-04 22:28:52 +08:00
primary_key: Option<String>,
2021-02-04 00:44:20 +08:00
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type")]
pub enum UpdateMeta {
2021-02-13 19:22:59 +08:00
DocumentsAddition {
method: IndexDocumentsMethod,
format: UpdateFormat,
primary_key: Option<String>,
},
ClearDocuments,
2021-02-13 00:39:14 +08:00
DeleteDocuments,
Settings(Settings),
Facets(Facets),
2021-01-14 00:50:36 +08:00
}
2021-01-14 00:50:36 +08:00
2021-02-09 23:08:13 +08:00
#[derive(Clone, Debug)]
pub struct IndexSettings {
pub name: Option<String>,
pub primary_key: Option<String>,
}