From 26f0fa678d217f3e987da2ec3bc3e801da678694 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Thu, 22 Jun 2023 14:28:32 +0200 Subject: [PATCH] Change the error message when a facet is not searchable --- milli/src/error.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/milli/src/error.rs b/milli/src/error.rs index 4f9a9028f..1e8e767d3 100644 --- a/milli/src/error.rs +++ b/milli/src/error.rs @@ -128,11 +128,11 @@ only composed of alphanumeric characters (a-z A-Z 0-9), hyphens (-) and undersco } )] InvalidSortableAttribute { field: String, valid_fields: BTreeSet }, - #[error("Attribute `{}` is not filterable. {}", + #[error("Attribute `{}` is not facet-searchable. {}", .field, match .valid_fields.is_empty() { - true => "This index does not have configured filterable attributes.".to_string(), - false => format!("Available filterable attributes are: `{}`.", + true => "This index does not have configured facet-searchable attributes. To make it facet-searchable add it to the `filterableAttributes` index settings.".to_string(), + false => format!("Available facet-searchable attributes are: `{}`. To make it facet-searchable add it to the `filterableAttributes` index settings.", valid_fields.iter().map(AsRef::as_ref).collect::>().join(", ") ), }