mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 11:57:07 +02:00
Add index exists function in index_scheduler
This commit is contained in:
parent
05cc2d1fac
commit
47e526f5ea
3 changed files with 21 additions and 9 deletions
|
@ -102,7 +102,7 @@ pub trait Analytics: Sync + Send {
|
|||
/// This method should be called to aggregate post facet values searches
|
||||
fn post_facet_search(&self, aggregate: FacetSearchAggregator);
|
||||
|
||||
// this method should be called to aggregate a add documents request
|
||||
// this method should be called to aggregate an add documents request
|
||||
fn add_documents(
|
||||
&self,
|
||||
documents_query: &UpdateDocumentsQuery,
|
||||
|
|
|
@ -304,7 +304,11 @@ pub async fn replace_documents(
|
|||
debug!(parameters = ?params, "Replace documents");
|
||||
let params = params.into_inner();
|
||||
|
||||
analytics.add_documents(¶ms, index_scheduler.index(&index_uid).is_err(), &req);
|
||||
analytics.add_documents(
|
||||
¶ms,
|
||||
!matches!(index_scheduler.index_exists(&index_uid), Ok(true)),
|
||||
&req,
|
||||
);
|
||||
|
||||
let allow_index_creation = index_scheduler.filters().allow_index_creation(&index_uid);
|
||||
let uid = get_task_id(&req, &opt)?;
|
||||
|
@ -341,7 +345,11 @@ pub async fn update_documents(
|
|||
let params = params.into_inner();
|
||||
debug!(parameters = ?params, "Update documents");
|
||||
|
||||
analytics.update_documents(¶ms, index_scheduler.index(&index_uid).is_err(), &req);
|
||||
analytics.update_documents(
|
||||
¶ms,
|
||||
!matches!(index_scheduler.index_exists(&index_uid), Ok(true)),
|
||||
&req,
|
||||
);
|
||||
|
||||
let allow_index_creation = index_scheduler.filters().allow_index_creation(&index_uid);
|
||||
let uid = get_task_id(&req, &opt)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue