mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 00:55:00 +08:00
Fix other unrelated tests
This commit is contained in:
parent
efea1e5837
commit
6592746337
@ -14,7 +14,7 @@ async fn formatted_contain_wildcard() {
|
|||||||
index.add_documents(documents, None).await;
|
index.add_documents(documents, None).await;
|
||||||
index.wait_task(1).await;
|
index.wait_task(1).await;
|
||||||
|
|
||||||
index.search(json!({ "q": "pesti", "attributesToRetrieve": ["father", "mother"], "attributesToHighlight": ["father", "mother", "*"], "attributesToCrop": ["doggos"], "showMatchesPosition": true }),
|
index.search(json!({ "q": "pésti", "attributesToRetrieve": ["father", "mother"], "attributesToHighlight": ["father", "mother", "*"], "attributesToCrop": ["doggos"], "showMatchesPosition": true }),
|
||||||
|response, code|
|
|response, code|
|
||||||
{
|
{
|
||||||
assert_eq!(code, 200, "{}", response);
|
assert_eq!(code, 200, "{}", response);
|
||||||
@ -23,7 +23,7 @@ async fn formatted_contain_wildcard() {
|
|||||||
json!({
|
json!({
|
||||||
"_formatted": {
|
"_formatted": {
|
||||||
"id": "852",
|
"id": "852",
|
||||||
"cattos": "<em>pesti</em>",
|
"cattos": "<em>pésti</em>",
|
||||||
},
|
},
|
||||||
"_matchesPosition": {"cattos": [{"start": 0, "length": 5}]},
|
"_matchesPosition": {"cattos": [{"start": 0, "length": 5}]},
|
||||||
})
|
})
|
||||||
@ -33,13 +33,13 @@ async fn formatted_contain_wildcard() {
|
|||||||
.await;
|
.await;
|
||||||
|
|
||||||
index
|
index
|
||||||
.search(json!({ "q": "pesti", "attributesToRetrieve": ["*"] }), |response, code| {
|
.search(json!({ "q": "pésti", "attributesToRetrieve": ["*"] }), |response, code| {
|
||||||
assert_eq!(code, 200, "{}", response);
|
assert_eq!(code, 200, "{}", response);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
response["hits"][0],
|
response["hits"][0],
|
||||||
json!({
|
json!({
|
||||||
"id": 852,
|
"id": 852,
|
||||||
"cattos": "pesti",
|
"cattos": "pésti",
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
@ -47,17 +47,17 @@ async fn formatted_contain_wildcard() {
|
|||||||
|
|
||||||
index
|
index
|
||||||
.search(
|
.search(
|
||||||
json!({ "q": "pesti", "attributesToRetrieve": ["*"], "attributesToHighlight": ["id"], "showMatchesPosition": true }),
|
json!({ "q": "pésti", "attributesToRetrieve": ["*"], "attributesToHighlight": ["id"], "showMatchesPosition": true }),
|
||||||
|response, code| {
|
|response, code| {
|
||||||
assert_eq!(code, 200, "{}", response);
|
assert_eq!(code, 200, "{}", response);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
response["hits"][0],
|
response["hits"][0],
|
||||||
json!({
|
json!({
|
||||||
"id": 852,
|
"id": 852,
|
||||||
"cattos": "pesti",
|
"cattos": "pésti",
|
||||||
"_formatted": {
|
"_formatted": {
|
||||||
"id": "852",
|
"id": "852",
|
||||||
"cattos": "pesti",
|
"cattos": "pésti",
|
||||||
},
|
},
|
||||||
"_matchesPosition": {"cattos": [{"start": 0, "length": 5}]},
|
"_matchesPosition": {"cattos": [{"start": 0, "length": 5}]},
|
||||||
})
|
})
|
||||||
@ -68,17 +68,17 @@ async fn formatted_contain_wildcard() {
|
|||||||
|
|
||||||
index
|
index
|
||||||
.search(
|
.search(
|
||||||
json!({ "q": "pesti", "attributesToRetrieve": ["*"], "attributesToCrop": ["*"] }),
|
json!({ "q": "pésti", "attributesToRetrieve": ["*"], "attributesToCrop": ["*"] }),
|
||||||
|response, code| {
|
|response, code| {
|
||||||
assert_eq!(code, 200, "{}", response);
|
assert_eq!(code, 200, "{}", response);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
response["hits"][0],
|
response["hits"][0],
|
||||||
json!({
|
json!({
|
||||||
"id": 852,
|
"id": 852,
|
||||||
"cattos": "pesti",
|
"cattos": "pésti",
|
||||||
"_formatted": {
|
"_formatted": {
|
||||||
"id": "852",
|
"id": "852",
|
||||||
"cattos": "pesti",
|
"cattos": "pésti",
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@ -87,16 +87,16 @@ async fn formatted_contain_wildcard() {
|
|||||||
.await;
|
.await;
|
||||||
|
|
||||||
index
|
index
|
||||||
.search(json!({ "q": "pesti", "attributesToCrop": ["*"] }), |response, code| {
|
.search(json!({ "q": "pésti", "attributesToCrop": ["*"] }), |response, code| {
|
||||||
assert_eq!(code, 200, "{}", response);
|
assert_eq!(code, 200, "{}", response);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
response["hits"][0],
|
response["hits"][0],
|
||||||
json!({
|
json!({
|
||||||
"id": 852,
|
"id": 852,
|
||||||
"cattos": "pesti",
|
"cattos": "pésti",
|
||||||
"_formatted": {
|
"_formatted": {
|
||||||
"id": "852",
|
"id": "852",
|
||||||
"cattos": "pesti",
|
"cattos": "pésti",
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@ -114,7 +114,7 @@ async fn format_nested() {
|
|||||||
index.wait_task(0).await;
|
index.wait_task(0).await;
|
||||||
|
|
||||||
index
|
index
|
||||||
.search(json!({ "q": "pesti", "attributesToRetrieve": ["doggos"] }), |response, code| {
|
.search(json!({ "q": "pésti", "attributesToRetrieve": ["doggos"] }), |response, code| {
|
||||||
assert_eq!(code, 200, "{}", response);
|
assert_eq!(code, 200, "{}", response);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
response["hits"][0],
|
response["hits"][0],
|
||||||
@ -136,7 +136,7 @@ async fn format_nested() {
|
|||||||
|
|
||||||
index
|
index
|
||||||
.search(
|
.search(
|
||||||
json!({ "q": "pesti", "attributesToRetrieve": ["doggos.name"] }),
|
json!({ "q": "pésti", "attributesToRetrieve": ["doggos.name"] }),
|
||||||
|response, code| {
|
|response, code| {
|
||||||
assert_eq!(code, 200, "{}", response);
|
assert_eq!(code, 200, "{}", response);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
@ -180,7 +180,7 @@ async fn format_nested() {
|
|||||||
.await;
|
.await;
|
||||||
|
|
||||||
index
|
index
|
||||||
.search(json!({ "q": "pesti", "attributesToRetrieve": [], "attributesToHighlight": ["doggos.name"] }),
|
.search(json!({ "q": "pésti", "attributesToRetrieve": [], "attributesToHighlight": ["doggos.name"] }),
|
||||||
|response, code| {
|
|response, code| {
|
||||||
assert_eq!(code, 200, "{}", response);
|
assert_eq!(code, 200, "{}", response);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
@ -202,7 +202,7 @@ async fn format_nested() {
|
|||||||
.await;
|
.await;
|
||||||
|
|
||||||
index
|
index
|
||||||
.search(json!({ "q": "pesti", "attributesToRetrieve": [], "attributesToCrop": ["doggos.name"] }),
|
.search(json!({ "q": "pésti", "attributesToRetrieve": [], "attributesToCrop": ["doggos.name"] }),
|
||||||
|response, code| {
|
|response, code| {
|
||||||
assert_eq!(code, 200, "{}", response);
|
assert_eq!(code, 200, "{}", response);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
@ -224,7 +224,7 @@ async fn format_nested() {
|
|||||||
.await;
|
.await;
|
||||||
|
|
||||||
index
|
index
|
||||||
.search(json!({ "q": "pesti", "attributesToRetrieve": ["doggos.name"], "attributesToHighlight": ["doggos.age"] }),
|
.search(json!({ "q": "pésti", "attributesToRetrieve": ["doggos.name"], "attributesToHighlight": ["doggos.age"] }),
|
||||||
|response, code| {
|
|response, code| {
|
||||||
assert_eq!(code, 200, "{}", response);
|
assert_eq!(code, 200, "{}", response);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
@ -256,7 +256,7 @@ async fn format_nested() {
|
|||||||
.await;
|
.await;
|
||||||
|
|
||||||
index
|
index
|
||||||
.search(json!({ "q": "pesti", "attributesToRetrieve": [], "attributesToHighlight": ["doggos.age"], "attributesToCrop": ["doggos.name"] }),
|
.search(json!({ "q": "pésti", "attributesToRetrieve": [], "attributesToHighlight": ["doggos.age"], "attributesToCrop": ["doggos.name"] }),
|
||||||
|response, code| {
|
|response, code| {
|
||||||
assert_eq!(code, 200, "{}", response);
|
assert_eq!(code, 200, "{}", response);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
@ -71,7 +71,7 @@ async fn simple_search_single_index() {
|
|||||||
"indexUid": "test",
|
"indexUid": "test",
|
||||||
"hits": [
|
"hits": [
|
||||||
{
|
{
|
||||||
"title": "Glass",
|
"title": "Gläss",
|
||||||
"id": "450465"
|
"id": "450465"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -166,7 +166,7 @@ async fn simple_search_two_indexes() {
|
|||||||
let (response, code) = server
|
let (response, code) = server
|
||||||
.multi_search(json!({"queries": [
|
.multi_search(json!({"queries": [
|
||||||
{"indexUid" : "test", "q": "glass"},
|
{"indexUid" : "test", "q": "glass"},
|
||||||
{"indexUid": "nested", "q": "pesti"},
|
{"indexUid": "nested", "q": "pésti"},
|
||||||
]}))
|
]}))
|
||||||
.await;
|
.await;
|
||||||
snapshot!(code, @"200 OK");
|
snapshot!(code, @"200 OK");
|
||||||
@ -176,7 +176,7 @@ async fn simple_search_two_indexes() {
|
|||||||
"indexUid": "test",
|
"indexUid": "test",
|
||||||
"hits": [
|
"hits": [
|
||||||
{
|
{
|
||||||
"title": "Glass",
|
"title": "Gläss",
|
||||||
"id": "450465"
|
"id": "450465"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -203,7 +203,7 @@ async fn simple_search_two_indexes() {
|
|||||||
"age": 4
|
"age": 4
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"cattos": "pesti"
|
"cattos": "pésti"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 654,
|
"id": 654,
|
||||||
@ -221,7 +221,7 @@ async fn simple_search_two_indexes() {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"query": "pesti",
|
"query": "pésti",
|
||||||
"processingTimeMs": "[time]",
|
"processingTimeMs": "[time]",
|
||||||
"limit": 20,
|
"limit": 20,
|
||||||
"offset": 0,
|
"offset": 0,
|
||||||
@ -243,7 +243,7 @@ async fn search_one_index_doesnt_exist() {
|
|||||||
let (response, code) = server
|
let (response, code) = server
|
||||||
.multi_search(json!({"queries": [
|
.multi_search(json!({"queries": [
|
||||||
{"indexUid" : "test", "q": "glass"},
|
{"indexUid" : "test", "q": "glass"},
|
||||||
{"indexUid": "nested", "q": "pesti"},
|
{"indexUid": "nested", "q": "pésti"},
|
||||||
]}))
|
]}))
|
||||||
.await;
|
.await;
|
||||||
snapshot!(code, @"400 Bad Request");
|
snapshot!(code, @"400 Bad Request");
|
||||||
@ -264,7 +264,7 @@ async fn search_multiple_indexes_dont_exist() {
|
|||||||
let (response, code) = server
|
let (response, code) = server
|
||||||
.multi_search(json!({"queries": [
|
.multi_search(json!({"queries": [
|
||||||
{"indexUid" : "test", "q": "glass"},
|
{"indexUid" : "test", "q": "glass"},
|
||||||
{"indexUid": "nested", "q": "pesti"},
|
{"indexUid": "nested", "q": "pésti"},
|
||||||
]}))
|
]}))
|
||||||
.await;
|
.await;
|
||||||
snapshot!(code, @"400 Bad Request");
|
snapshot!(code, @"400 Bad Request");
|
||||||
@ -296,7 +296,7 @@ async fn search_one_query_error() {
|
|||||||
let (response, code) = server
|
let (response, code) = server
|
||||||
.multi_search(json!({"queries": [
|
.multi_search(json!({"queries": [
|
||||||
{"indexUid" : "test", "q": "glass", "facets": ["title"]},
|
{"indexUid" : "test", "q": "glass", "facets": ["title"]},
|
||||||
{"indexUid": "nested", "q": "pesti"},
|
{"indexUid": "nested", "q": "pésti"},
|
||||||
]}))
|
]}))
|
||||||
.await;
|
.await;
|
||||||
snapshot!(code, @"400 Bad Request");
|
snapshot!(code, @"400 Bad Request");
|
||||||
@ -328,7 +328,7 @@ async fn search_multiple_query_errors() {
|
|||||||
let (response, code) = server
|
let (response, code) = server
|
||||||
.multi_search(json!({"queries": [
|
.multi_search(json!({"queries": [
|
||||||
{"indexUid" : "test", "q": "glass", "facets": ["title"]},
|
{"indexUid" : "test", "q": "glass", "facets": ["title"]},
|
||||||
{"indexUid": "nested", "q": "pesti", "facets": ["doggos"]},
|
{"indexUid": "nested", "q": "pésti", "facets": ["doggos"]},
|
||||||
]}))
|
]}))
|
||||||
.await;
|
.await;
|
||||||
snapshot!(code, @"400 Bad Request");
|
snapshot!(code, @"400 Bad Request");
|
||||||
|
Loading…
Reference in New Issue
Block a user