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
[Rollup] Proactively resolve index patterns in RollupSearch endoint #34930
Merged
polyfractal
merged 3 commits into
elastic:master
from
polyfractal:rollup_expand_wildcards_search
Oct 30, 2018
Merged
[Rollup] Proactively resolve index patterns in RollupSearch endoint #34930
polyfractal
merged 3 commits into
elastic:master
from
polyfractal:rollup_expand_wildcards_search
Oct 30, 2018
Conversation
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 changes the RollupSearch endpoint to proactively resolve index patterns. If the index pattern(s) match more than one rollup index, an exception is throw as before. But if the pattern only matches one rollup index, execution is allowed to continue (unlike before where it would assume all patterns were for raw data). Also tweaks the documentation to make this clear. Closes elastic#34828
polyfractal
added
>bug
v7.0.0
:StorageEngine/Rollup
Turn fine-grained time-based data into coarser-grained data
v6.5.0
v6.6.0
labels
Oct 26, 2018
Pinging @elastic/es-search-aggs |
jimczi
approved these changes
Oct 26, 2018
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 left a small comment regarding the tests with alias, LGTM otherwise
} | ||
return new RollupSearchContext(normal.toArray(new String[normal.size()]), rollup.toArray(new String[rollup.size()]), jobCaps); | ||
return new RollupSearchContext(normal.toArray(new String[0]), rollup.toArray(new String[0]), jobCaps); |
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.
This reminds me a recent email ;)
x-pack/plugin/src/test/resources/rest-api-spec/test/rollup/rollup_search.yml
Show resolved
Hide resolved
.../rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportRollupSearchAction.java
Show resolved
Hide resolved
polyfractal
added a commit
that referenced
this pull request
Oct 30, 2018
…34930) This changes the RollupSearch endpoint to proactively resolve index patterns. If the index pattern(s) match more than one rollup index, an exception is throw as before. But if the pattern only matches one rollup index, execution is allowed to continue (unlike before where it would assume all patterns were for raw data). This also allows the search endpoint to resolve aliases that point to a rollup index. Also tweaks the documentation to make this clear. Closes #34828
polyfractal
added a commit
that referenced
this pull request
Oct 30, 2018
…34930) This changes the RollupSearch endpoint to proactively resolve index patterns. If the index pattern(s) match more than one rollup index, an exception is throw as before. But if the pattern only matches one rollup index, execution is allowed to continue (unlike before where it would assume all patterns were for raw data). This also allows the search endpoint to resolve aliases that point to a rollup index. Also tweaks the documentation to make this clear. Closes #34828
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
>bug
:StorageEngine/Rollup
Turn fine-grained time-based data into coarser-grained data
v6.5.0
v6.6.0
v7.0.0-beta1
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.
This changes the RollupSearch endpoint to proactively resolve index patterns.
Today, we assume any index that doesn't have a rollup cap to be a raw/live index. But if the user specifies a wildcard pattern on a rollup index (
rollup-foo*
), this causes a problem. We can't find an index that matches the exact string"rollup-foo*"
so we assume it is a live index and pass it off to the regular Search endpoint. Search resolves that to the rollup index, searches it but gets no hits because none of the names match. The result is an empty search response that doesn't make sense to the user.Instead, we should resolve index patterns up front in the RollupSearch endpoint. If the index pattern(s) match more than one rollup index, an exception is thrown just like before. But if the pattern only matches one rollup index, execution is allowed to continue.
Regular indices continue to function as before, the only difference is that we resolve the pattern and search with a list instead of the pattern (e.g. search for
logstash-1,logstash-2,logstash-3
instead oflogstash-*
).Also tweaks the documentation to make this clear.
Closes #34828
Kibana has requested this as blocker for 6.5. The change is pretty minimal and should be safe I think. I don't think it would be the end of the world if it slipped to 6.5.1 though.