Skip to content

Commit

Permalink
add test for delete on es API
Browse files Browse the repository at this point in the history
  • Loading branch information
PSeitz committed Feb 21, 2024
1 parent 26d1564 commit 41fc263
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
2 changes: 1 addition & 1 deletion quickwit/quickwit-serve/src/elasticsearch_api/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ pub(crate) fn elastic_delete_index_filter(
) -> impl Filter<Extract = (Vec<String>,), Error = Rejection> + Clone {
warp::path!("_elastic" / String)
.and_then(extract_index_id_patterns)
.and(warp::get())
.and(warp::delete())
}

// No support for any query parameters for now.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
method: POST
api_root: http://localhost:7280/api/v1/
endpoint: indexes/
json:
version: "0.7"
index_id: test_index1
doc_mapping:
mode: dynamic
sleep_after: 3
---
method: POST
api_root: http://localhost:7280/api/v1/
endpoint: indexes/
json:
version: "0.7"
index_id: test_index2
doc_mapping:
mode: dynamic
sleep_after: 3
---
method: DELETE
api_root: http://localhost:7280/api/v1/
endpoint: _elastic/test_index1,does_not_exist
status_code: 404
---
method: DELETE
api_root: http://localhost:7280/api/v1/
endpoint: _elastic/test_index1,test_index2
status_code: 200
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,18 @@ endpoint: indexes/gharchive
method: DELETE
api_root: http://localhost:7280/api/v1/
endpoint: indexes/empty_index
---
method: DELETE
api_root: http://localhost:7280/api/v1/
endpoint: indexes/test_index1
status_code: null
--- # Cleanup
method: DELETE
api_root: http://localhost:7280/api/v1/
endpoint: indexes/test_index2
status_code: null
--- # Cleanup
method: DELETE
api_root: http://localhost:7280/api/v1/
endpoint: indexes/test_index1
status_code: null

0 comments on commit 41fc263

Please sign in to comment.