Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static SetPriorityAction parse(XContentParser parser) {
}

public SetPriorityAction(@Nullable Integer recoveryPriority) {
if (recoveryPriority != null && recoveryPriority <= 0) {
if (recoveryPriority != null && recoveryPriority < 0) {
throw new IllegalArgumentException("[" + RECOVERY_PRIORITY_FIELD.getPreferredName() + "] must be 0 or greater");
}
this.recoveryPriority = recoveryPriority;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected boolean supportsUnknownFields() {
}

public void testNonPositivePriority() {
Exception e = expectThrows(Exception.class, () -> new SetPriorityAction(randomIntBetween(-100, 0)));
Exception e = expectThrows(Exception.class, () -> new SetPriorityAction(randomIntBetween(-100, -1)));
assertThat(e.getMessage(), equalTo("[priority] must be 0 or greater"));
}

Expand Down
6 changes: 0 additions & 6 deletions x-pack/docs/en/watcher/transform/search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ The following table lists all available settings for the search transform:

| `request.indices` | no | all indices | One or more indices to search on.

| `request.types` | no | all types | One or more document types to search on (may be a
comma-delimited string or an array of document types
names)

| `request.body` | no | `match_all` query | The body of the request. The
{ref}/search-request-body.html[request body] follows
the same structure you normally send in the body of
Expand Down Expand Up @@ -105,7 +101,6 @@ time of the watch:
"search" : {
"request" : {
"indices" : [ "logstash-*" ],
"types" : [ "event" ],
"body" : {
"size" : 0,
"query" : {
Expand Down Expand Up @@ -145,7 +140,6 @@ The following is an example of using templates that refer to provided parameters
"search" : {
"request" : {
"indices" : [ "logstash-*" ],
"types" : [ "event" ],
"template" : {
"source" : {
"size" : 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ protected Reader<SetPriorityAction> instanceReader() {
return SetPriorityAction::new;
}

@AwaitsFix(bugUrl="https://github.com/elastic/elasticsearch/issues/37652")
public void testNonPositivePriority() {
Exception e = expectThrows(Exception.class, () -> new SetPriorityAction(randomIntBetween(-100, 0)));
Exception e = expectThrows(Exception.class, () -> new SetPriorityAction(randomIntBetween(-100, -1)));
assertThat(e.getMessage(), equalTo("[priority] must be 0 or greater"));
}

Expand Down