-
Notifications
You must be signed in to change notification settings - Fork 491
Support ignore_unavailable query param #5971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
c0440f2 to
c296938
Compare
guilload
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved! Left a bunch of nits. Thank you @rdettai-sk !
|
|
||
| CountHits count_hits = 17; | ||
|
|
||
| // When an exact index_id is provided (not a pattern), the query fails if that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // When an exact index_id is provided (not a pattern), the query fails if that | |
| // When an exact index ID is provided (not a pattern), the query fails only if that index is not found and this parameter is set to `false`. |
| &indexes_metadata[..], | ||
| &search_request.index_id_patterns[..], | ||
| )?; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests in the file. Tedious but doable :) You can also push the ignore_missing_indexes parameter to check_all_index_metadata_found and just unit test that function instead. That would make me happy too :)
| pub ignore_unavailable: Option<bool>, | ||
| #[serde_as(deserialize_as = "OneOrMany<_, PreferMany>")] | ||
| #[serde(default)] | ||
| pub index: Vec<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment such as List of indexes to search, rename the variable to indexes and use #[serde(rename = "index")] (assuming it works with serde_as.
| - hits: | ||
| total: | ||
| value: 0 | ||
| status: 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: please add missing new line
| value: 4 | ||
|
|
||
|
|
||
|
No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, remove the extra empty lines and insert the missing new line. Your editor can do that automatically.
Description
ignore_unavailable is an ES query param that enables skipping indexes that don't exist without throwing an error. It is false by default (aligns with the current behavior which is to throw an error).
This PR enables the support for this query param in both _search and _msearch
How was this PR tested?
Integration tests, running on both ES and QW