add primary key and update documents

This commit is contained in:
mpostma
2021-02-13 12:22:59 +01:00
parent 3a634cb583
commit 1eaf28f823
5 changed files with 95 additions and 35 deletions

View File

@ -16,6 +16,7 @@ impl Data {
method: IndexDocumentsMethod,
format: UpdateFormat,
mut stream: impl futures::Stream<Item=Result<B, E>> + Unpin,
primary_key: Option<String>,
) -> anyhow::Result<UpdateStatus>
where
B: Deref<Target = [u8]>,
@ -47,7 +48,7 @@ impl Data {
mmap = unsafe { memmap::Mmap::map(&file)? };
&mmap
};
index_controller.add_documents(index, method, format, &bytes)
index_controller.add_documents(index, method, format, &bytes, primary_key)
}).await??;
Ok(update.into())
}