-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Report if index is hidden in index stats #18706
Merged
ycombinator
merged 5 commits into
elastic:master
from
ycombinator:mb-es-xp-index-mark-hidden
Jul 8, 2020
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
abc108b
Use expand_wildcards in tests as well
ycombinator c8c35ad
Report index hidden setting in index stats
ycombinator 987c583
Adding CHANGELOG entry
ycombinator 87b73dd
Using json.Unmarshaler instead
ycombinator eb621b5
Hybrid approach
ycombinator File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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.
why not
Hidden bool
, orIndex IndexSettings json:"index"
?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.
It had to do with the type of
index.hidden
in the Elasticsearch API's JSON response being a string, e.g."true"
, instead of being a JSON boolean, e.g.true
. Let me make a commit showing what I tried before this, implementingjson.Unmarshaler
, then we can decide which implementation we like better.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.
@urso I've made an alternate implementation (the one I tried originally) in 87b73dd. Let me know if you prefer that or the one right before that. Thanks!
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.
Uff, I see. If we would use something like
boolstr
more often we might consider to provide a package/library with decoding primitives. But here as a standalone single use case within the package I think I prefer to decode into string first. A hybrid solution could beIndex struct { Hidden boolstr
json:"index"}
, but keepIndexSetting{ Hidden bool }
. Then you might be able to cast fromIndex
intoIndexSetting
directly. Usingboolstr
we see decoding errors directly returned from the JSON decoder if something changes.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.
Thanks, let me try the hybrid solution next.
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.
@urso Implemented the hybrid approach in eb621b5. Let me know what you think. Thanks!