MeiliSearch/src/index_controller/mod.rs

44 lines
1.0 KiB
Rust
Raw Normal View History

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