Remove irrelevant test index method

This commit is contained in:
ManyTheFish
2025-10-13 15:46:30 +02:00
parent f19f712433
commit ed6f479940
3 changed files with 8 additions and 21 deletions

View File

@@ -528,21 +528,6 @@ impl<State> Index<'_, State> {
self.service.post_str(url, body, all_headers).await self.service.post_str(url, body, all_headers).await
} }
pub async fn multi_search_post(&self, queries: Value) -> (Value, StatusCode) {
self.service.post("/multi-search", queries).await
}
pub async fn multi_search_post_with_headers(
&self,
queries: Value,
headers: Vec<(&str, &str)>,
) -> (Value, StatusCode) {
let body = serde_json::to_string(&queries).unwrap();
let mut all_headers = vec![("content-type", "application/json")];
all_headers.extend(headers);
self.service.post_str("/multi-search", body, all_headers).await
}
pub async fn search_get(&self, query: &str) -> (Value, StatusCode) { pub async fn search_get(&self, query: &str) -> (Value, StatusCode) {
let url = format!("/indexes/{}/search{}", urlencode(self.uid.as_ref()), query); let url = format!("/indexes/{}/search{}", urlencode(self.uid.as_ref()), query);
self.service.get(url).await self.service.get(url).await

View File

@@ -390,13 +390,15 @@ impl<State> Server<State> {
self.service.post("/multi-search", queries).await self.service.post("/multi-search", queries).await
} }
pub async fn multi_search_post_with_headers( pub async fn multi_search_with_headers(
&self, &self,
queries: Value, queries: Value,
headers: Vec<(&str, &str)>, headers: Vec<(&str, &str)>,
) -> (Value, StatusCode) { ) -> (Value, StatusCode) {
let body = serde_json::to_string(&queries).unwrap(); let body = serde_json::to_string(&queries).unwrap();
self.service.post_str("/multi-search", body, headers).await let mut all_headers = vec![("content-type", "application/json")];
all_headers.extend(headers);
self.service.post_str("/multi-search", body, all_headers).await
} }
pub async fn list_indexes_raw(&self, parameters: &str) -> (Value, StatusCode) { pub async fn list_indexes_raw(&self, parameters: &str) -> (Value, StatusCode) {

View File

@@ -129,8 +129,8 @@ async fn multi_search_without_metadata_header() {
server.wait_task(task.uid()).await.succeeded(); server.wait_task(task.uid()).await.succeeded();
// Test multi-search without metadata header // Test multi-search without metadata header
let (response, code) = index let (response, code) = server
.multi_search_post(json!({ .multi_search(json!({
"queries": [ "queries": [
{"indexUid": index.uid, "q": "glass"}, {"indexUid": index.uid, "q": "glass"},
{"indexUid": index.uid, "q": "dragon"} {"indexUid": index.uid, "q": "dragon"}
@@ -195,8 +195,8 @@ async fn multi_search_with_metadata_header() {
server.wait_task(task.uid()).await.succeeded(); server.wait_task(task.uid()).await.succeeded();
// Test multi-search with metadata header // Test multi-search with metadata header
let (response, code) = index let (response, code) = server
.multi_search_post_with_headers( .multi_search_with_headers(
json!({ json!({
"queries": [ "queries": [
{"indexUid": index.uid, "q": "glass"}, {"indexUid": index.uid, "q": "glass"},