mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
tests: Use Server::wait_task() instead of Index::wait_task() in search::
The code is mostly duplicated. Server::wait_task() has better handling for errors and more retries. Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
This commit is contained in:
parent
fc6cc80705
commit
855fa555a3
12 changed files with 160 additions and 160 deletions
|
@ -26,7 +26,7 @@ async fn search_formatted_from_sdk() {
|
|||
{ "id": 42, "title": "The Hitchhiker's Guide to the Galaxy" }
|
||||
]);
|
||||
let (response, _) = index.add_documents(documents, None).await;
|
||||
index.wait_task(response.uid()).await;
|
||||
server.wait_task(response.uid()).await;
|
||||
|
||||
index
|
||||
.search(
|
||||
|
@ -65,7 +65,7 @@ async fn formatted_contain_wildcard() {
|
|||
|
||||
let documents = NESTED_DOCUMENTS.clone();
|
||||
let (response, _) = index.add_documents(documents, None).await;
|
||||
index.wait_task(response.uid()).await.succeeded();
|
||||
server.wait_task(response.uid()).await.succeeded();
|
||||
|
||||
index.search(json!({ "q": "pésti", "attributesToRetrieve": ["father", "mother"], "attributesToHighlight": ["father", "mother", "*"], "attributesToCrop": ["doggos"], "showMatchesPosition": true }),
|
||||
|response, code|
|
||||
|
@ -398,7 +398,7 @@ async fn displayedattr_2_smol() {
|
|||
|
||||
let documents = NESTED_DOCUMENTS.clone();
|
||||
let (response, _) = index.add_documents(documents, None).await;
|
||||
index.wait_task(response.uid()).await.succeeded();
|
||||
server.wait_task(response.uid()).await.succeeded();
|
||||
|
||||
index
|
||||
.search(json!({ "attributesToRetrieve": ["father", "id"], "attributesToHighlight": ["mother"], "attributesToCrop": ["cattos"] }),
|
||||
|
@ -596,7 +596,7 @@ async fn test_cjk_highlight() {
|
|||
{ "id": 1, "title": "大卫到了扫罗那里" },
|
||||
]);
|
||||
let (response, _) = index.add_documents(documents, None).await;
|
||||
index.wait_task(response.uid()).await.succeeded();
|
||||
server.wait_task(response.uid()).await.succeeded();
|
||||
|
||||
index
|
||||
.search(json!({"q": "で", "attributesToHighlight": ["title"]}), |response, code| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue