Add support for rest_total_hits_as_int in watcher#36035
Merged
jimczi merged 3 commits intoelastic:masterfrom Nov 30, 2018
Merged
Add support for rest_total_hits_as_int in watcher#36035jimczi merged 3 commits intoelastic:masterfrom
jimczi merged 3 commits intoelastic:masterfrom
Conversation
This change adds the support for rest_total_hits_as_int in the watcher search inputs. Setting this parameter in the request will transform the search response to contain the total hits as a number (instead of an object). Note that this parameter is currently a noop since elastic#35849 is not merged. Closes elastic#36008
Collaborator
|
Pinging @elastic/es-core-features |
Collaborator
|
Pinging @elastic/es-search |
spinscale
approved these changes
Nov 30, 2018
Contributor
spinscale
left a comment
There was a problem hiding this comment.
two minor cosmetic things, otherwise LGTM (no need for a further round), as tests seem to pass
| final Payload payload; | ||
| if (input.getExtractKeys() != null) { | ||
| BytesReference bytes = XContentHelper.toXContent(response, XContentType.JSON, false); | ||
| Map<String, String> paramsMap = new HashMap<>(); |
Contributor
There was a problem hiding this comment.
instead of allocating a new objects, can you juse have a static MapParams variable, that uses Collections.singletonMap()?
| indicesOptions, searchSource, template); | ||
| WatcherSearchTemplateRequest request = new WatcherSearchTemplateRequest(indices.toArray(new String[0]), | ||
| types.toArray(new String[0]), searchType, indicesOptions, searchSource, template); | ||
| if (totalHitsAsInt) { |
Contributor
There was a problem hiding this comment.
is this if statement needed with the above defined default value?
jpountz
approved these changes
Nov 30, 2018
jimczi
added a commit
that referenced
this pull request
Nov 30, 2018
This change adds the support for rest_total_hits_as_int in the watcher search inputs. Setting this parameter in the request will transform the search response to contain the total hits as a number (instead of an object). Note that this parameter is currently a noop since #35849 is not merged. Closes #36008
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.
This change adds the support for rest_total_hits_as_int
in the watcher search inputs. Setting this parameter in the request
will transform the search response to contain the total hits as
a number (instead of an object).
Note that this parameter is currently a noop since #35849 is not
merged.
Closes #36008