mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-10-31 07:56:28 +00:00 
			
		
		
		
	Fix typos in comments and messages
This commit is contained in:
		| @@ -10,7 +10,7 @@ source: crates/index-scheduler/src/scheduler/test_failure.rs | ||||
| 1 {uid: 1, batch_uid: 1, status: succeeded, details: { received_documents: 3, indexed_documents: Some(3) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 3, allow_index_creation: true }} | ||||
| 2 {uid: 2, batch_uid: 2, status: succeeded, details: { received_document_ids: 1, deleted_documents: Some(1) }, kind: DocumentDeletion { index_uid: "doggos", documents_ids: ["1"] }} | ||||
| 3 {uid: 3, batch_uid: 2, status: failed, error: ResponseError { code: 200, message: "Index `doggos`: Invalid type for filter subexpression: expected: String, Array, found: true.", error_code: "invalid_document_filter", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#invalid_document_filter" }, details: { original_filter: true, deleted_documents: Some(0) }, kind: DocumentDeletionByFilter { index_uid: "doggos", filter_expr: Bool(true) }} | ||||
| 4 {uid: 4, batch_uid: 2, status: failed, error: ResponseError { code: 200, message: "Index `doggos`: Attribute `id` is not filterable. Available filterable attributes patterns are: `catto`.\n1:3 id = 2", error_code: "invalid_document_filter", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#invalid_document_filter" }, details: { original_filter: "id = 2", deleted_documents: Some(0) }, kind: DocumentDeletionByFilter { index_uid: "doggos", filter_expr: String("id = 2") }} | ||||
| 4 {uid: 4, batch_uid: 2, status: failed, error: ResponseError { code: 200, message: "Index `doggos`: Attribute `id` is not filterable. Available filterable attribute patterns are: `catto`.\n1:3 id = 2", error_code: "invalid_document_filter", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#invalid_document_filter" }, details: { original_filter: "id = 2", deleted_documents: Some(0) }, kind: DocumentDeletionByFilter { index_uid: "doggos", filter_expr: String("id = 2") }} | ||||
| 5 {uid: 5, batch_uid: 2, status: succeeded, details: { original_filter: "catto EXISTS", deleted_documents: Some(1) }, kind: DocumentDeletionByFilter { index_uid: "doggos", filter_expr: String("catto EXISTS") }} | ||||
| ---------------------------------------------------------------------- | ||||
| ### Status: | ||||
|   | ||||
| @@ -636,7 +636,7 @@ async fn delete_document_by_filter() { | ||||
|         "originalFilter": "\"catto = jorts\"" | ||||
|       }, | ||||
|       "error": { | ||||
|         "message": "Index `SHARED_DOCUMENTS`: Attribute `catto` is not filterable. Available filterable attributes patterns are: `id`, `title`.\n1:6 catto = jorts", | ||||
|         "message": "Index `SHARED_DOCUMENTS`: Attribute `catto` is not filterable. Available filterable attribute patterns are: `id`, `title`.\n1:6 catto = jorts", | ||||
|         "code": "invalid_document_filter", | ||||
|         "type": "invalid_request", | ||||
|         "link": "https://docs.meilisearch.com/errors#invalid_document_filter" | ||||
| @@ -738,7 +738,7 @@ async fn fetch_document_by_filter() { | ||||
|     snapshot!(code, @"400 Bad Request"); | ||||
|     snapshot!(response, @r###" | ||||
|     { | ||||
|       "message": "Attribute `doggo` is not filterable. Available filterable attributes patterns are: `color`.\n1:6 doggo = bernese", | ||||
|       "message": "Attribute `doggo` is not filterable. Available filterable attribute patterns are: `color`.\n1:6 doggo = bernese", | ||||
|       "code": "invalid_document_filter", | ||||
|       "type": "invalid_request", | ||||
|       "link": "https://docs.meilisearch.com/errors#invalid_document_filter" | ||||
|   | ||||
| @@ -708,7 +708,7 @@ async fn filter_invalid_attribute_array() { | ||||
|         |response, code| { | ||||
|             snapshot!(response, @r###" | ||||
|             { | ||||
|               "message": "Index `test`: Attribute `many` is not filterable. Available filterable attributes patterns are: `title`.\n1:5 many = Glass", | ||||
|               "message": "Index `test`: Attribute `many` is not filterable. Available filterable attribute patterns are: `title`.\n1:5 many = Glass", | ||||
|               "code": "invalid_search_filter", | ||||
|               "type": "invalid_request", | ||||
|               "link": "https://docs.meilisearch.com/errors#invalid_search_filter" | ||||
| @@ -729,7 +729,7 @@ async fn filter_invalid_attribute_string() { | ||||
|         |response, code| { | ||||
|             snapshot!(response, @r###" | ||||
|             { | ||||
|               "message": "Index `test`: Attribute `many` is not filterable. Available filterable attributes patterns are: `title`.\n1:5 many = Glass", | ||||
|               "message": "Index `test`: Attribute `many` is not filterable. Available filterable attribute patterns are: `title`.\n1:5 many = Glass", | ||||
|               "code": "invalid_search_filter", | ||||
|               "type": "invalid_request", | ||||
|               "link": "https://docs.meilisearch.com/errors#invalid_search_filter" | ||||
|   | ||||
| @@ -720,7 +720,7 @@ async fn test_filterable_attributes_priority() { | ||||
|             snapshot!(code, @"400 Bad Request"); | ||||
|             snapshot!(json_string!(response), @r###" | ||||
|             { | ||||
|               "message": "Index `test`: Attribute `doggos.age` is not filterable. Available filterable attributes patterns are: `doggos.*`.\n1:11 doggos.age > 2", | ||||
|               "message": "Index `test`: Attribute `doggos.age` is not filterable. Available filterable attribute patterns are: `doggos.*`.\n1:11 doggos.age > 2", | ||||
|               "code": "invalid_search_filter", | ||||
|               "type": "invalid_request", | ||||
|               "link": "https://docs.meilisearch.com/errors#invalid_search_filter" | ||||
| @@ -746,7 +746,7 @@ async fn test_filterable_attributes_priority() { | ||||
|             snapshot!(code, @"400 Bad Request"); | ||||
|             snapshot!(json_string!(response), @r###" | ||||
|             { | ||||
|               "message": "Index `test`: Attribute `doggos` is not filterable. Available filterable attributes patterns are: `doggos.*`.\n1:7 doggos EXISTS", | ||||
|               "message": "Index `test`: Attribute `doggos` is not filterable. Available filterable attribute patterns are: `doggos.*`.\n1:7 doggos EXISTS", | ||||
|               "code": "invalid_search_filter", | ||||
|               "type": "invalid_request", | ||||
|               "link": "https://docs.meilisearch.com/errors#invalid_search_filter" | ||||
|   | ||||
| @@ -1753,7 +1753,7 @@ async fn test_nested_fields() { | ||||
|             assert_eq!(code, 400, "{}", response); | ||||
|             snapshot!(json_string!(response), @r###" | ||||
|             { | ||||
|               "message": "Index `test`: Attribute `nested` is not filterable. Available filterable attributes patterns are: `nested.machin`, `nested.object`, `title`.\n1:7 nested = array", | ||||
|               "message": "Index `test`: Attribute `nested` is not filterable. Available filterable attribute patterns are: `nested.machin`, `nested.object`, `title`.\n1:7 nested = array", | ||||
|               "code": "invalid_search_filter", | ||||
|               "type": "invalid_request", | ||||
|               "link": "https://docs.meilisearch.com/errors#invalid_search_filter" | ||||
| @@ -1772,7 +1772,7 @@ async fn test_nested_fields() { | ||||
|             assert_eq!(code, 400, "{}", response); | ||||
|             snapshot!(json_string!(response), @r###" | ||||
|             { | ||||
|               "message": "Index `test`: Attribute `nested` is not filterable. Available filterable attributes patterns are: `nested.machin`, `nested.object`, `title`.\n1:7 nested = \"I lied\"", | ||||
|               "message": "Index `test`: Attribute `nested` is not filterable. Available filterable attribute patterns are: `nested.machin`, `nested.object`, `title`.\n1:7 nested = \"I lied\"", | ||||
|               "code": "invalid_search_filter", | ||||
|               "type": "invalid_request", | ||||
|               "link": "https://docs.meilisearch.com/errors#invalid_search_filter" | ||||
|   | ||||
| @@ -459,7 +459,7 @@ async fn filter_invalid_attribute_array() { | ||||
|                 snapshot!(code, @"400 Bad Request"); | ||||
|                 snapshot!(response, @r###" | ||||
|                 { | ||||
|                   "message": "Attribute `many` is not filterable. Available filterable attributes patterns are: `title`.\n1:5 many = Glass", | ||||
|                   "message": "Attribute `many` is not filterable. Available filterable attribute patterns are: `title`.\n1:5 many = Glass", | ||||
|                   "code": "invalid_similar_filter", | ||||
|                   "type": "invalid_request", | ||||
|                   "link": "https://docs.meilisearch.com/errors#invalid_similar_filter" | ||||
| @@ -500,7 +500,7 @@ async fn filter_invalid_attribute_string() { | ||||
|                 snapshot!(code, @"400 Bad Request"); | ||||
|                 snapshot!(response, @r###" | ||||
|                 { | ||||
|                   "message": "Attribute `many` is not filterable. Available filterable attributes patterns are: `title`.\n1:5 many = Glass", | ||||
|                   "message": "Attribute `many` is not filterable. Available filterable attribute patterns are: `title`.\n1:5 many = Glass", | ||||
|                   "code": "invalid_similar_filter", | ||||
|                   "type": "invalid_request", | ||||
|                   "link": "https://docs.meilisearch.com/errors#invalid_similar_filter" | ||||
|   | ||||
| @@ -350,7 +350,7 @@ impl<'a> FacetDistribution<'a> { | ||||
|         Ok(distribution) | ||||
|     } | ||||
|  | ||||
|     /// Select a field if it is faceted and in the facets. | ||||
|     /// Select a field if it is filterable and in the facets. | ||||
|     fn select_field( | ||||
|         &self, | ||||
|         name: &str, | ||||
| @@ -372,7 +372,7 @@ impl<'a> FacetDistribution<'a> { | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /// Check if the fields in the facets are valid faceted fields. | ||||
|     /// Check if the fields in the facets are valid filterable fields. | ||||
|     fn check_faceted_fields( | ||||
|         &self, | ||||
|         filterable_attributes_rules: &[FilterableAttributesRule], | ||||
|   | ||||
| @@ -82,7 +82,7 @@ impl<'a> Display for FilterError<'a> { | ||||
|                 if filterable_patterns.is_empty() { | ||||
|                     write!(f, " This index does not have configured filterable attributes.") | ||||
|                 } else { | ||||
|                     write!(f, " Available filterable attributes patterns are: ")?; | ||||
|                     write!(f, " Available filterable attribute patterns are: ")?; | ||||
|                     let mut filterables_list = | ||||
|                         filterable_patterns.iter().map(AsRef::as_ref).collect::<Vec<&str>>(); | ||||
|                     filterables_list.sort_unstable(); | ||||
| @@ -911,42 +911,42 @@ mod tests { | ||||
|         let filter = Filter::from_str("_geoRadius(-100, 150, 10)").unwrap().unwrap(); | ||||
|         let error = filter.evaluate(&rtxn, &index).unwrap_err(); | ||||
|         snapshot!(error.to_string(), @r###" | ||||
|         Attribute `_geo` is not filterable. Available filterable attributes patterns are: `title`. | ||||
|         Attribute `_geo` is not filterable. Available filterable attribute patterns are: `title`. | ||||
|         12:16 _geoRadius(-100, 150, 10) | ||||
|         "###); | ||||
|  | ||||
|         let filter = Filter::from_str("_geoBoundingBox([42, 150], [30, 10])").unwrap().unwrap(); | ||||
|         let error = filter.evaluate(&rtxn, &index).unwrap_err(); | ||||
|         snapshot!(error.to_string(), @r###" | ||||
|         Attribute `_geo` is not filterable. Available filterable attributes patterns are: `title`. | ||||
|         Attribute `_geo` is not filterable. Available filterable attribute patterns are: `title`. | ||||
|         18:20 _geoBoundingBox([42, 150], [30, 10]) | ||||
|         "###); | ||||
|  | ||||
|         let filter = Filter::from_str("name = 12").unwrap().unwrap(); | ||||
|         let error = filter.evaluate(&rtxn, &index).unwrap_err(); | ||||
|         snapshot!(error.to_string(), @r###" | ||||
|         Attribute `name` is not filterable. Available filterable attributes patterns are: `title`. | ||||
|         Attribute `name` is not filterable. Available filterable attribute patterns are: `title`. | ||||
|         1:5 name = 12 | ||||
|         "###); | ||||
|  | ||||
|         let filter = Filter::from_str("title = \"test\" AND name = 12").unwrap().unwrap(); | ||||
|         let error = filter.evaluate(&rtxn, &index).unwrap_err(); | ||||
|         snapshot!(error.to_string(), @r###" | ||||
|         Attribute `name` is not filterable. Available filterable attributes patterns are: `title`. | ||||
|         Attribute `name` is not filterable. Available filterable attribute patterns are: `title`. | ||||
|         20:24 title = "test" AND name = 12 | ||||
|         "###); | ||||
|  | ||||
|         let filter = Filter::from_str("title = \"test\" AND name IN [12]").unwrap().unwrap(); | ||||
|         let error = filter.evaluate(&rtxn, &index).unwrap_err(); | ||||
|         snapshot!(error.to_string(), @r###" | ||||
|         Attribute `name` is not filterable. Available filterable attributes patterns are: `title`. | ||||
|         Attribute `name` is not filterable. Available filterable attribute patterns are: `title`. | ||||
|         20:24 title = "test" AND name IN [12] | ||||
|         "###); | ||||
|  | ||||
|         let filter = Filter::from_str("title = \"test\" AND name != 12").unwrap().unwrap(); | ||||
|         let error = filter.evaluate(&rtxn, &index).unwrap_err(); | ||||
|         snapshot!(error.to_string(), @r###" | ||||
|         Attribute `name` is not filterable. Available filterable attributes patterns are: `title`. | ||||
|         Attribute `name` is not filterable. Available filterable attribute patterns are: `title`. | ||||
|         20:24 title = "test" AND name != 12 | ||||
|         "###); | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user