mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Fix PR comments
This commit is contained in:
parent
b664a46e91
commit
b59145385e
3 changed files with 103 additions and 7 deletions
|
@ -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"
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue