Skip to content

No way to ignore unavailable indices after upgrade from 4.x #2639

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

Closed
virtual-machinist opened this issue Jul 20, 2023 · 1 comment · Fixed by #2642
Closed

No way to ignore unavailable indices after upgrade from 4.x #2639

virtual-machinist opened this issue Jul 20, 2023 · 1 comment · Fixed by #2642
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@virtual-machinist
Copy link

Since the new API doesn't support the old indices options, I have no practical way to tell the server to ignore a missing index when doing a search in multiple indices. So when I do a search with an index missing, I get an error instead of no results for that particular index (a totally acceptable service degradation).

However co.elastic.clients.elasticsearch.core.SearchRequest.Builder does allow setting ignoreUnavailable and it works for both older (7.17.x) and newer (8.8.x) ES servers I tested it on when setting the option via debugger.

Is there a way to expose this option somewhere if not in BaseQueryBuilder then at least NativeQueryBuilder I use in conjunction with ElasticsearchTemplate? Or some workaround other than preemptively fetching and caching the available indices.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 20, 2023
@sothawo
Copy link
Collaborator

sothawo commented Jul 21, 2023

Query can have an IndicesOptions property. The Elasticsearch client did not have the possibility to add this when the first integration was done, so this query property was skipped in building the request. Even now it seems that not all of the previously available values are supported, but I'll add whatever can be done now. This includes ignoreUnavailable. I created #2641 for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants