mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-06-18 12:47:35 +02:00
Use unique_index_with_prefix() instead of composing the index names manually with Uuid
Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
This commit is contained in:
parent
e8774ad079
commit
2269104337
@ -1,6 +1,5 @@
|
|||||||
use meili_snap::{json_string, snapshot};
|
use meili_snap::{json_string, snapshot};
|
||||||
use tokio::sync::OnceCell;
|
use tokio::sync::OnceCell;
|
||||||
use uuid::Uuid;
|
|
||||||
|
|
||||||
use super::{DOCUMENTS, FRUITS_DOCUMENTS, NESTED_DOCUMENTS};
|
use super::{DOCUMENTS, FRUITS_DOCUMENTS, NESTED_DOCUMENTS};
|
||||||
use crate::common::index::Index;
|
use crate::common::index::Index;
|
||||||
@ -849,13 +848,13 @@ async fn federation_one_index_doesnt_exist() {
|
|||||||
async fn search_multiple_indexes_dont_exist() {
|
async fn search_multiple_indexes_dont_exist() {
|
||||||
let server = Server::new_shared();
|
let server = Server::new_shared();
|
||||||
|
|
||||||
let index_1 = format!("index_1-{}", Uuid::new_v4());
|
let index_1 = server.unique_index_with_prefix("index_1");
|
||||||
let index_2 = format!("index_2-{}", Uuid::new_v4());
|
let index_2 = server.unique_index_with_prefix("index_2");
|
||||||
|
|
||||||
let (response, code) = server
|
let (response, code) = server
|
||||||
.multi_search(json!({"queries": [
|
.multi_search(json!({"queries": [
|
||||||
{"indexUid" : index_1, "q": "glass"},
|
{"indexUid" : index_1.uid, "q": "glass"},
|
||||||
{"indexUid": index_2, "q": "pésti"},
|
{"indexUid": index_2.uid, "q": "pésti"},
|
||||||
]}))
|
]}))
|
||||||
.await;
|
.await;
|
||||||
snapshot!(code, @"400 Bad Request");
|
snapshot!(code, @"400 Bad Request");
|
||||||
@ -873,13 +872,13 @@ async fn search_multiple_indexes_dont_exist() {
|
|||||||
async fn federation_multiple_indexes_dont_exist() {
|
async fn federation_multiple_indexes_dont_exist() {
|
||||||
let server = Server::new_shared();
|
let server = Server::new_shared();
|
||||||
|
|
||||||
let index_1 = format!("index_1-{}", Uuid::new_v4());
|
let index_1 = server.unique_index_with_prefix("index_1");
|
||||||
let index_2 = format!("index_2-{}", Uuid::new_v4());
|
let index_2 = server.unique_index_with_prefix("index_2");
|
||||||
|
|
||||||
let (response, code) = server
|
let (response, code) = server
|
||||||
.multi_search(json!({"federation": {}, "queries": [
|
.multi_search(json!({"federation": {}, "queries": [
|
||||||
{"indexUid" : index_1, "q": "glass"},
|
{"indexUid" : index_1.uid, "q": "glass"},
|
||||||
{"indexUid": index_2, "q": "pésti"},
|
{"indexUid": index_2.uid, "q": "pésti"},
|
||||||
]}))
|
]}))
|
||||||
.await;
|
.await;
|
||||||
snapshot!(code, @"400 Bad Request");
|
snapshot!(code, @"400 Bad Request");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user