Skip to content

Commit

Permalink
Bugfix on scroll id
Browse files Browse the repository at this point in the history
  • Loading branch information
fulmicoton committed Oct 30, 2023
1 parent 43eab7f commit c930ec0
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
14 changes: 13 additions & 1 deletion quickwit/quickwit-search/src/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,19 @@ pub async fn root_search(
check_all_index_metadata_found(&indexes_metadata[..], &search_request.index_id_patterns[..])?;

if indexes_metadata.is_empty() {
return Ok(SearchResponse::default());
// We go through root_search_aux instead of directly
// returning an empty response to make sure we generate
// a (pretty useless) scroll id if requested.
let mut search_response = root_search_aux(
searcher_context,
&HashMap::default(),
search_request,
Vec::new(),
cluster_client,
)
.await?;
search_response.elapsed_time_micros = start_instant.elapsed().as_micros() as u64;
return Ok(search_response);
}

let index_uids = indexes_metadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,16 @@ json:
store:
scroll_id: _scroll_id
status_code: 404
---
endpoint: "non-existing-index-*/_search"
params:
size: 1
scroll: 30m
json:
query:
match_all: {}
sort:
- actor.id:
order: desc
expected:
$expect: "'_scroll_id' in val"
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,17 @@ expected:
- doc_count: 1
key: trinity
sum_other_doc_count: 0
---
# Test date histogram aggregation
method: [POST]
endpoint: "noindexmatching-*/_search"
json:
query: { match_all: {} }
aggs:
logins:
terms:
field: "actor.login"
order:
_key: asc
expected:
$expect: "not 'aggregations' in val"

0 comments on commit c930ec0

Please sign in to comment.