-
Notifications
You must be signed in to change notification settings - Fork 25.2k
[Docs] Clarify default value for allow_no_indices
#52635
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
Conversation
Add a cliarification that default value is `true`, so no error is returned if no index is matched. Fixes: elastic#52534
Pinging @elastic/es-core-features (:Core/Features/Indices APIs) |
Pinging @elastic/es-docs (>docs) |
@@ -42,6 +42,7 @@ tag::allow-no-indices[] | |||
the request does *not* return an error | |||
if a wildcard expression | |||
or `_all` value retrieves only missing or closed indices. | |||
Defaults to `true`. |
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.
I'm afraid that the default value here depends on the API, or is it true
for all APIs?
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.
I tried some of them like HEAD, _mapping, _forgemerge and they behave the same.
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.
The default is API dependant. For example the put mapping api defaults to false.
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.
I see, should we just add a sentence that the default value depends on the API instead?
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.
You can add the default value where the definition is included instead:
include::{docdir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
+
Defaults to `true`.
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.
@jrodewig ++
Checked all usages and added the default value to the doc references. I have another question though, if you check this: https://github.com/elastic/elasticsearch/pull/52635/files#diff-2e0eb1b85aa4eba2d58663601327caffL39 I'm wondering if we should do the same for the index exists api ( |
include::{docdir}/rest-api/common-parms.asciidoc[tag=allow-no-indices] | ||
|
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.
👍
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.
I'm not 100% sure.
The mechanism is different, but the outcome the same (status 200 or 404).
If allow_no_indices=false
and no index is matched then we get an exception at the index name resolution phase which is translated to 404.
If allow_no_indices=true
and no index is matched then no aliases are found and this is again translated to 404.
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.
I think we should probably remove documentation for this parameter. It's not useful to the end user and the outcome will be the same regardless. Thanks for catching this @matriv.
@jrodewig FYI, I added also this: 9902b34#diff-72be49b35e089e3c18cadc2619d1d933R99 |
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.
LGTM. Thanks @matriv!
Add default value to each one of the usages of `allow_no_indices` since it differs between different APIs. Relates to: elastic#52534 (cherry picked from commit 2eb9864)
Add default value to each one of the usages of
allow_no_indices
since it differs between different APIs.
Relates to: #52534