mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-25 07:41:00 +00:00
Fix PR comments
This commit is contained in:
@ -997,3 +997,32 @@ async fn error_add_documents_payload_size() {
|
||||
assert_eq!(response, expected_response);
|
||||
assert_eq!(code, 413);
|
||||
}
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn error_primary_key_inference() {
|
||||
let server = Server::new().await;
|
||||
let index = server.index("test");
|
||||
|
||||
let documents = json!([
|
||||
{
|
||||
"title": "11",
|
||||
"desc": "foobar"
|
||||
}
|
||||
]);
|
||||
|
||||
index.add_documents(documents, None).await;
|
||||
index.wait_update_id(0).await;
|
||||
let (response, code) = index.get_update(0).await;
|
||||
assert_eq!(code, 200);
|
||||
assert_eq!(response["status"], "failed");
|
||||
assert_eq!(
|
||||
response["message"],
|
||||
r#"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."#
|
||||
);
|
||||
assert_eq!(response["code"], "primary_key_inference_failed");
|
||||
assert_eq!(response["type"], "invalid_request");
|
||||
assert_eq!(
|
||||
response["link"],
|
||||
"https://docs.meilisearch.com/errors#primary_key_inference_failed"
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user