add primary key and update documents

This commit is contained in:
mpostma 2021-02-13 12:22:59 +01:00
parent 3a634cb583
commit 1eaf28f823
No known key found for this signature in database
GPG key ID: CBC8A7C1D7A28C3A
5 changed files with 95 additions and 35 deletions

View file

@ -31,7 +31,11 @@ pub struct IndexMetadata {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type")]
pub enum UpdateMeta {
DocumentsAddition { method: IndexDocumentsMethod, format: UpdateFormat },
DocumentsAddition {
method: IndexDocumentsMethod,
format: UpdateFormat,
primary_key: Option<String>,
},
ClearDocuments,
DeleteDocuments,
Settings(Settings),
@ -128,6 +132,7 @@ pub trait IndexController {
method: IndexDocumentsMethod,
format: UpdateFormat,
data: &[u8],
primary_key: Option<String>,
) -> anyhow::Result<UpdateStatus>;
/// Clear all documents in the given index.