From a0a3b55700aaf6bd633d57b494d53ce66df0bf72 Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Thu, 5 Dec 2024 14:48:29 +0100 Subject: [PATCH] Change error code --- crates/meilisearch-types/src/error.rs | 2 +- crates/meilisearch/src/search/mod.rs | 2 +- crates/meilisearch/tests/search/facet_search.rs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/meilisearch-types/src/error.rs b/crates/meilisearch-types/src/error.rs index c68059682..afc876b42 100644 --- a/crates/meilisearch-types/src/error.rs +++ b/crates/meilisearch-types/src/error.rs @@ -279,7 +279,7 @@ InvalidSearchPage , InvalidRequest , BAD_REQUEST ; InvalidSearchQ , InvalidRequest , BAD_REQUEST ; InvalidFacetSearchQuery , InvalidRequest , BAD_REQUEST ; InvalidFacetSearchName , InvalidRequest , BAD_REQUEST ; -InvalidFacetSearchDisabled , InvalidRequest , BAD_REQUEST ; +FacetSearchDisabled , InvalidRequest , BAD_REQUEST ; InvalidSearchVector , InvalidRequest , BAD_REQUEST ; InvalidSearchShowMatchesPosition , InvalidRequest , BAD_REQUEST ; InvalidSearchShowRankingScore , InvalidRequest , BAD_REQUEST ; diff --git a/crates/meilisearch/src/search/mod.rs b/crates/meilisearch/src/search/mod.rs index 9e0c936b7..7beaad6a5 100644 --- a/crates/meilisearch/src/search/mod.rs +++ b/crates/meilisearch/src/search/mod.rs @@ -1410,7 +1410,7 @@ pub fn perform_facet_search( if !index.facet_search(&rtxn)? { return Err(ResponseError::from_msg( "The facet search is disabled for this index".to_string(), - Code::InvalidFacetSearchDisabled, + Code::FacetSearchDisabled, )); } diff --git a/crates/meilisearch/tests/search/facet_search.rs b/crates/meilisearch/tests/search/facet_search.rs index 23f312490..19224c3df 100644 --- a/crates/meilisearch/tests/search/facet_search.rs +++ b/crates/meilisearch/tests/search/facet_search.rs @@ -225,9 +225,9 @@ async fn add_documents_and_deactivate_facet_search() { snapshot!(response, @r###" { "message": "The facet search is disabled for this index", - "code": "invalid_facet_search_disabled", + "code": "facet_search_disabled", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_facet_search_disabled" + "link": "https://docs.meilisearch.com/errors#facet_search_disabled" } "###); } @@ -256,9 +256,9 @@ async fn deactivate_facet_search_and_add_documents() { snapshot!(response, @r###" { "message": "The facet search is disabled for this index", - "code": "invalid_facet_search_disabled", + "code": "facet_search_disabled", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_facet_search_disabled" + "link": "https://docs.meilisearch.com/errors#facet_search_disabled" } "###); }