fix(api): field_caps resolves real glob wildcards, not just bare */_all - #10
Merged
xerj-team merged 1 commit intoJul 24, 2026
Merged
Conversation
…all"
field_caps had its own inline index-resolution logic that only
special-cased the literal wildcards "*" and "_all" (all indices).
Any other wildcard pattern (e.g. "wiki-test*") fell through to
resolve_alias(n.trim()), which looks up an exact alias name — so a
real glob pattern was treated as a literal, nonexistent index/alias
name and silently returned empty field caps.
This is the root cause of Kibana's (and OpenSearch Dashboards') index
pattern / data view creation failing with wildcarded patterns: the
UI's field-discovery call against */"pattern*" comes back with
"fields": {} even though the underlying indices exist and match.
Confirmed with a clean A/B: GET /wiki-test/_field_caps returns all
fields correctly; GET /wiki-test*/_field_caps returned
"indices": ["wiki-test*"] (literally unresolved) and "fields": {}.
Fix: delegate to resolve_index_selector(), the same glob-aware
resolver already used by bulk/aliases/delete-by-query elsewhere in
this file (via glob_match_simple) — no new logic, just reusing what
already works correctly.
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
field_capshad its own inline index-resolution logic that only special-cased the literal wildcards*and_all(all indices). Any other wildcard pattern (e.g.wiki-test*) fell through toresolve_alias(n.trim()), which looks up an exact alias name — so a real glob pattern was treated as a literal, nonexistent index/alias name and silently returned empty field caps.Why this matters: this is the root cause of Kibana's (and likely OpenSearch Dashboards') index pattern / data view creation failing with wildcarded patterns — the UI's field-discovery call against a pattern like
wiki-test*comes back with"fields": {}even though the underlying indices exist and match.Repro (clean A/B):
Fix: delegate to
resolve_index_selector(), the same glob-aware resolver (viaglob_match_simple) already used by bulk/aliases/delete-by-query elsewhere in this file — no new logic, just reusing what already works correctly there.Tested:
cargo build --release -p xerj-apiclean, verified via curl that wildcarded_field_capsnow returns real fields instead of an empty object.