Skip to content

Fix watcher check that determines when to serialize indices options. #78070

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

Merged
merged 1 commit into from
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -140,7 +140,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
builder.rawField(BODY_FIELD.getPreferredName(), stream);
}
}
if (indicesOptions != DEFAULT_INDICES_OPTIONS) {
if (indicesOptions.equals(DEFAULT_INDICES_OPTIONS) == false) {
builder.startObject(INDICES_OPTIONS_FIELD.getPreferredName());
indicesOptions.toXContent(builder, params);
builder.endObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public void testResponseToData() throws Exception {
assertThat(result, equalTo(expected));
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/78035")
public void testSerializeSearchRequest() throws Exception {
String[] expectedIndices = generateRandomStringArray(5, 5, true);
IndicesOptions expectedIndicesOptions = IndicesOptions.fromOptions(randomBoolean(), randomBoolean(), randomBoolean(),
Expand Down Expand Up @@ -155,7 +154,6 @@ public void testSerializeSearchRequest() throws Exception {
}
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/78035")
public void testDeserializeSearchRequest() throws Exception {

XContentBuilder builder = jsonBuilder().startObject();
Expand All @@ -175,9 +173,11 @@ public void testDeserializeSearchRequest() throws Exception {
indicesOptions = IndicesOptions.fromOptions(randomBoolean(), randomBoolean(), randomBoolean(),
randomBoolean(), randomBoolean(), indicesOptions.allowAliasesToMultipleIndices(),
indicesOptions.forbidClosedIndices(), indicesOptions.ignoreAliases(), indicesOptions.ignoreThrottled());
builder.startObject("indices_options");
indicesOptions.toXContent(builder, ToXContent.EMPTY_PARAMS);
builder.endObject();
if (indicesOptions.equals(DEFAULT_INDICES_OPTIONS) == false) {
builder.startObject("indices_options");
indicesOptions.toXContent(builder, ToXContent.EMPTY_PARAMS);
builder.endObject();
}
}

SearchType searchType = SearchType.DEFAULT;
Expand Down