Skip to content

Conversation

@rdettai-sk
Copy link
Collaborator

@rdettai-sk rdettai-sk commented Nov 4, 2025

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

@rdettai-sk rdettai-sk self-assigned this Nov 4, 2025
@rdettai-sk rdettai-sk added the enhancement New feature or request label Nov 4, 2025
@rdettai-sk rdettai-sk force-pushed the support-ignore-unavailable branch from c0440f2 to c296938 Compare November 4, 2025 18:03
@rdettai-sk rdettai-sk requested review from guilload and removed request for PSeitz and PSeitz-dd November 6, 2025 07:55
Copy link
Member

@guilload guilload left a 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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[..],
)?;
}
Copy link
Member

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>,
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants