implement search and fix document addition

This commit is contained in:
mpostma 2021-02-27 10:19:05 +01:00
parent 658166c05e
commit c4dfd5f0c3
No known key found for this signature in database
GPG key ID: CBC8A7C1D7A28C3A
9 changed files with 842 additions and 33 deletions

View file

@ -13,6 +13,8 @@ use milli::update::{IndexDocumentsMethod, UpdateFormat, DocumentAdditionResult};
use serde::{Serialize, Deserialize, de::Deserializer};
use uuid::Uuid;
use tokio::fs::File;
use crate::data::SearchResult;
use crate::data::SearchQuery;
pub use updates::{Processed, Processing, Failed};
@ -135,6 +137,8 @@ pub trait IndexController {
primary_key: Option<String>,
) -> anyhow::Result<UpdateStatus>;
async fn search(&self, name: String, query: SearchQuery) -> Result<SearchResult>;
/// Clear all documents in the given index.
fn clear_documents(&self, index: String) -> anyhow::Result<UpdateStatus>;