412: Change Attribute and Ranking rules errors r=ManyTheFish a=ManyTheFish

# Pull Request

Fixes Meilisearch [PR comment](https://github.com/meilisearch/MeiliSearch/pull/1873#issuecomment-959786406)


Co-authored-by: many <maxime@meilisearch.com>
This commit is contained in:
bors[bot] 2021-11-04 13:08:50 +00:00 committed by GitHub
commit a2fc74f010
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "cli" name = "cli"
version = "0.20.1" version = "0.20.2"
edition = "2018" edition = "2018"
description = "A CLI to interact with a milli index" description = "A CLI to interact with a milli index"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "helpers" name = "helpers"
version = "0.20.1" version = "0.20.2"
authors = ["Clément Renault <clement@meilisearch.com>"] authors = ["Clément Renault <clement@meilisearch.com>"]
edition = "2018" edition = "2018"

View File

@ -1,7 +1,7 @@
[package] [package]
name = "http-ui" name = "http-ui"
description = "The HTTP user interface of the milli search engine" description = "The HTTP user interface of the milli search engine"
version = "0.20.1" version = "0.20.2"
authors = ["Clément Renault <clement@meilisearch.com>"] authors = ["Clément Renault <clement@meilisearch.com>"]
edition = "2018" edition = "2018"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "infos" name = "infos"
version = "0.20.1" version = "0.20.2"
authors = ["Clément Renault <clement@meilisearch.com>"] authors = ["Clément Renault <clement@meilisearch.com>"]
edition = "2018" edition = "2018"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "milli" name = "milli"
version = "0.20.1" version = "0.20.2"
authors = ["Kerollmops <clement@meilisearch.com>"] authors = ["Kerollmops <clement@meilisearch.com>"]
edition = "2018" edition = "2018"

View File

@ -17,7 +17,7 @@ pub enum CriterionError {
impl fmt::Display for CriterionError { impl fmt::Display for CriterionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self { match self {
Self::InvalidName { name } => write!(f, "invalid ranking rule {}", name), Self::InvalidName { name } => write!(f, "`{}` ranking rule is invalid. Valid ranking rules are Words, Typo, Sort, Proximity, Attribute, Exactness and custom ranking rules.", name),
Self::ReservedName { name } => { Self::ReservedName { name } => {
write!( write!(
f, f,

View File

@ -219,7 +219,7 @@ impl StdError for InternalError {}
impl fmt::Display for UserError { impl fmt::Display for UserError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self { match self {
Self::AttributeLimitReached => f.write_str("Maximum number of attributes reached."), Self::AttributeLimitReached => f.write_str("A document cannot contain more than 65,535 fields."),
Self::CriterionError(error) => write!(f, "{}", error), Self::CriterionError(error) => write!(f, "{}", error),
Self::DocumentLimitReached => f.write_str("Maximum number of documents reached."), Self::DocumentLimitReached => f.write_str("Maximum number of documents reached."),
Self::InvalidFacetsDistribution { invalid_facets_name } => { Self::InvalidFacetsDistribution { invalid_facets_name } => {
@ -277,7 +277,7 @@ ranking rules settings to use the sort parameter at search time.",
let json = serde_json::to_string(document).unwrap(); let json = serde_json::to_string(document).unwrap();
write!(f, "Document doesn't have a `{}` attribute: `{}`.", primary_key, json) write!(f, "Document doesn't have a `{}` attribute: `{}`.", primary_key, json)
} }
Self::MissingPrimaryKey => f.write_str("Missing primary key."), Self::MissingPrimaryKey => f.write_str("The primary key inference process failed because the engine did not find any fields containing `id` substring in their name. If your document identifier does not contain any `id` substring, you can set the primary key of the index."),
Self::MaxDatabaseSizeReached => f.write_str("Maximum database size has been reached."), Self::MaxDatabaseSizeReached => f.write_str("Maximum database size has been reached."),
Self::NoSpaceLeftOnDevice => f.write_str("There is no more space left on the device. Consider increasing the size of the disk/partition."), Self::NoSpaceLeftOnDevice => f.write_str("There is no more space left on the device. Consider increasing the size of the disk/partition."),
Self::InvalidStoreFile => f.write_str("The database file is in an invalid state."), Self::InvalidStoreFile => f.write_str("The database file is in an invalid state."),