mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 20:15:07 +08:00
Merge #3876
3876: Fix invalid attributeToSearchOn error code r=Kerollmops a=ManyTheFish Fix the invalid attributeToSearchOn error code to be consistent with the other search parameters' error codes: error code `invalid_attributes_to_search_on` becomes `invalid_search_attributes_to_search_on`: ```diff - invalid_attributes_to_search_on + invalid_search_attributes_to_search_on ``` related to #3772 Co-authored-by: ManyTheFish <many@meilisearch.com>
This commit is contained in:
commit
e871906370
@ -226,7 +226,7 @@ InvalidIndexLimit , InvalidRequest , BAD_REQUEST ;
|
|||||||
InvalidIndexOffset , InvalidRequest , BAD_REQUEST ;
|
InvalidIndexOffset , InvalidRequest , BAD_REQUEST ;
|
||||||
InvalidIndexPrimaryKey , InvalidRequest , BAD_REQUEST ;
|
InvalidIndexPrimaryKey , InvalidRequest , BAD_REQUEST ;
|
||||||
InvalidIndexUid , InvalidRequest , BAD_REQUEST ;
|
InvalidIndexUid , InvalidRequest , BAD_REQUEST ;
|
||||||
InvalidAttributesToSearchOn , InvalidRequest , BAD_REQUEST ;
|
InvalidSearchAttributesToSearchOn , InvalidRequest , BAD_REQUEST ;
|
||||||
InvalidSearchAttributesToCrop , InvalidRequest , BAD_REQUEST ;
|
InvalidSearchAttributesToCrop , InvalidRequest , BAD_REQUEST ;
|
||||||
InvalidSearchAttributesToHighlight , InvalidRequest , BAD_REQUEST ;
|
InvalidSearchAttributesToHighlight , InvalidRequest , BAD_REQUEST ;
|
||||||
InvalidSearchAttributesToRetrieve , InvalidRequest , BAD_REQUEST ;
|
InvalidSearchAttributesToRetrieve , InvalidRequest , BAD_REQUEST ;
|
||||||
@ -342,7 +342,7 @@ impl ErrorCode for milli::Error {
|
|||||||
UserError::InvalidFacetsDistribution { .. } => Code::InvalidSearchFacets,
|
UserError::InvalidFacetsDistribution { .. } => Code::InvalidSearchFacets,
|
||||||
UserError::InvalidSortableAttribute { .. } => Code::InvalidSearchSort,
|
UserError::InvalidSortableAttribute { .. } => Code::InvalidSearchSort,
|
||||||
UserError::InvalidSearchableAttribute { .. } => {
|
UserError::InvalidSearchableAttribute { .. } => {
|
||||||
Code::InvalidAttributesToSearchOn
|
Code::InvalidSearchAttributesToSearchOn
|
||||||
}
|
}
|
||||||
UserError::InvalidFacetSearchFacetName { .. } => {
|
UserError::InvalidFacetSearchFacetName { .. } => {
|
||||||
Code::InvalidFacetSearchFacetName
|
Code::InvalidFacetSearchFacetName
|
||||||
|
@ -40,7 +40,7 @@ pub struct FacetSearchQuery {
|
|||||||
pub filter: Option<Value>,
|
pub filter: Option<Value>,
|
||||||
#[deserr(default, error = DeserrJsonError<InvalidSearchMatchingStrategy>, default)]
|
#[deserr(default, error = DeserrJsonError<InvalidSearchMatchingStrategy>, default)]
|
||||||
pub matching_strategy: MatchingStrategy,
|
pub matching_strategy: MatchingStrategy,
|
||||||
#[deserr(default, error = DeserrJsonError<InvalidAttributesToSearchOn>, default)]
|
#[deserr(default, error = DeserrJsonError<InvalidSearchAttributesToSearchOn>, default)]
|
||||||
pub attributes_to_search_on: Option<Vec<String>>,
|
pub attributes_to_search_on: Option<Vec<String>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ pub struct SearchQueryGet {
|
|||||||
crop_marker: String,
|
crop_marker: String,
|
||||||
#[deserr(default, error = DeserrQueryParamError<InvalidSearchMatchingStrategy>)]
|
#[deserr(default, error = DeserrQueryParamError<InvalidSearchMatchingStrategy>)]
|
||||||
matching_strategy: MatchingStrategy,
|
matching_strategy: MatchingStrategy,
|
||||||
#[deserr(default, error = DeserrQueryParamError<InvalidAttributesToSearchOn>)]
|
#[deserr(default, error = DeserrQueryParamError<InvalidSearchAttributesToSearchOn>)]
|
||||||
pub attributes_to_search_on: Option<CS<String>>,
|
pub attributes_to_search_on: Option<CS<String>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ pub struct SearchQuery {
|
|||||||
pub crop_marker: String,
|
pub crop_marker: String,
|
||||||
#[deserr(default, error = DeserrJsonError<InvalidSearchMatchingStrategy>, default)]
|
#[deserr(default, error = DeserrJsonError<InvalidSearchMatchingStrategy>, default)]
|
||||||
pub matching_strategy: MatchingStrategy,
|
pub matching_strategy: MatchingStrategy,
|
||||||
#[deserr(default, error = DeserrJsonError<InvalidAttributesToSearchOn>, default)]
|
#[deserr(default, error = DeserrJsonError<InvalidSearchAttributesToSearchOn>, default)]
|
||||||
pub attributes_to_search_on: Option<Vec<String>>,
|
pub attributes_to_search_on: Option<Vec<String>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ pub struct SearchQueryWithIndex {
|
|||||||
pub crop_marker: String,
|
pub crop_marker: String,
|
||||||
#[deserr(default, error = DeserrJsonError<InvalidSearchMatchingStrategy>, default)]
|
#[deserr(default, error = DeserrJsonError<InvalidSearchMatchingStrategy>, default)]
|
||||||
pub matching_strategy: MatchingStrategy,
|
pub matching_strategy: MatchingStrategy,
|
||||||
#[deserr(default, error = DeserrJsonError<InvalidAttributesToSearchOn>, default)]
|
#[deserr(default, error = DeserrJsonError<InvalidSearchAttributesToSearchOn>, default)]
|
||||||
pub attributes_to_search_on: Option<Vec<String>>,
|
pub attributes_to_search_on: Option<Vec<String>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -980,9 +980,9 @@ async fn search_on_unknown_field() {
|
|||||||
snapshot!(json_string!(response), @r###"
|
snapshot!(json_string!(response), @r###"
|
||||||
{
|
{
|
||||||
"message": "Attribute `unknown` is not searchable. Available searchable attributes are: `id, title`.",
|
"message": "Attribute `unknown` is not searchable. Available searchable attributes are: `id, title`.",
|
||||||
"code": "invalid_attributes_to_search_on",
|
"code": "invalid_search_attributes_to_search_on",
|
||||||
"type": "invalid_request",
|
"type": "invalid_request",
|
||||||
"link": "https://docs.meilisearch.com/errors#invalid_attributes_to_search_on"
|
"link": "https://docs.meilisearch.com/errors#invalid_search_attributes_to_search_on"
|
||||||
}
|
}
|
||||||
"###);
|
"###);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user