opensearch-project / opensearch-project/OpenSearch
[BUG] Resolve Indices API: Doesn't throw Index not found exception for certain scenarios, doesn't support `_all`
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 13.7k
- Forks
- 3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 108
Description
Describe the bug
-
Resolve API doesn't throw index not found exception
curl -XGET https://localhost:9200/_resolve/index/random?ignore_unavailable=true&allow_no_indices=false -u 'admin:admin' --insecureempty results are returnedhowever for request with
random*
curl -XGET https://localhost:9200/_resolve/index/random*?ignore_unavailable=true&allow_no_indices=false -u 'admin:admin' --insecurethrowsindex_not_found_exception -
Resolve with
_alltarget returns empty results.
To Reproduce
Steps to reproduce the behavior:
-
Install latest OpenSearch and start local cluster. Follow instructions here
-
Make sure indices which starts with name
randomdoesn't exist.
curl -XGET https://localhost:9200/random* -u 'admin:admin' --insecureshould return empty. -
a. Call resolve API with
*
curl -XGET https://localhost:9200/_resolve/index/random*?ignore_unavailable=true&allow_no_indices=false -u 'admin:admin' --insecure
b. Call resolve API without*
curl -XGET https://localhost:9200/_resolve/index/random?ignore_unavailable=true&allow_no_indices=false -u 'admin:admin' --insecure -
Reproduce
_all
a. Create an Indexcurl --location --request PUT 'http://localhost:9200/test-index' \ --header 'Content-Type: application/json' \ --data-raw '{ "settings": { "index": { "number_of_shards": 2, "number_of_replicas": 1 } }, "mappings": { "properties": { "age": { "type": "integer" } } }, "aliases": { "sample-alias1": {} } }'b. Now try to resolve all indices using target as
_allcurl -XGET https://localhost:9200/_resolve/index/_all -u 'admin:admin' --insecure;
Expected behavior
- Either both requests throw exception or neither of the requests throw exception to be consistent.
- It should resolve all indices.
Host/Environment (please complete the following information):
- OS: Linux
- Version: 2.1.x
Additional context
- GetIndex API behavior
- With wildcard (
*)
- Throws exception whenallow_no_indices=false, ignore_unavailable option doesn’t matter. - Without wildcard
- Throws exception if either of the options (allow_no_indices and ignore_unavailable ) are false.
- With wildcard (
- ResolveIndex API behavior
- With wildcard (
*)
- Same behavior as GetIndex API - Without wildcard
- Doesn't throw exception for any combination ofallow_no_indicesandignore_unavailable. This is unlike GetIndex API.
- With wildcard (
- Also couldn't find documentation for resolve API here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the two cases with the provided curl commands on OpenSearch 2.1.x, then compare Resolve Index API behavior with Get Index API for wildcard and non-wildcard targets. Trace the Resolve Index API entry point and its handling of allow_no_indices, ignore_unavailable, and _all; done means consistent missing-index behavior and resolution of all indices.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend, search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100