Skip to content
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

Source filtering: only accept array items if the previous include pattern matches #22593

Merged
merged 2 commits into from Jan 13, 2017

Conversation

Projects
None yet
3 participants
@mikemccand
Copy link
Contributor

commented Jan 12, 2017

Source filtering was incorrectly always accepting array items even if the include pattern did not match.

Closes #22557

Source filtering: only accept array items if the previous include pat…
…tern matches

Source filtering was always accepting array items even if the include pattern did not match.

Closes #22557
assertThat((Integer) ((List) falteredMap.get("array")).get(0), equalTo(1));
assertThat(((Map<String, Object>) ((List) falteredMap.get("array")).get(1)).size(), equalTo(1));
assertThat((Integer) ((Map<String, Object>) ((List) falteredMap.get("array")).get(1)).get("nested"), equalTo(2));
assertThat(((List) filteredMap.get("array")).size(), equalTo(1));

This comment has been minimized.

Copy link
@nik9000

nik9000 Jan 12, 2017

Contributor

assertThat((List) filteredMap.get("array"), hasSize(1)) has better error messages.

This comment has been minimized.

Copy link
@nik9000

nik9000 Jan 12, 2017

Contributor

But you are just fixing a typo so you can skip it.

This comment has been minimized.

Copy link
@mikemccand

mikemccand Jan 12, 2017

Author Contributor

Oh thank you for that pointer; I didn't know about hasSize ... I'll change it

@mikemccand

This comment has been minimized.

Copy link
Contributor Author

commented Jan 12, 2017

OK I switched to hasSize and I also discovered that you can't use that for Map yet ... that's coming in next release of Hamcrest I guess.

@nik9000

This comment has been minimized.

Copy link
Contributor

commented Jan 12, 2017

you can't use that for Map yet ... that's coming in next release of Hamcrest I guess.

Oh!

@mikemccand mikemccand merged commit 568e655 into elastic:master Jan 13, 2017

2 checks passed

CLA Commit author is a member of Elasticsearch
Details
elasticsearch-ci Build finished.
Details

@mikemccand mikemccand deleted the mikemccand:source_include_arrays branch Jan 13, 2017

mikemccand added a commit that referenced this pull request Jan 13, 2017

Source filtering: only accept array items if the previous include pat…
…tern matches (#22593)

Source filtering was always accepting array items even if the include pattern did not match.

Closes #22557

@clintongormley clintongormley added >regression and removed >bug labels Jan 16, 2017

@clintongormley clintongormley added v5.3.0 and removed v5.2.0 labels Feb 7, 2017

mikemccand added a commit that referenced this pull request Feb 7, 2017

Source filtering: only accept array items if the previous include pat…
…tern matches (#22593)

Source filtering was always accepting array items even if the include pattern did not match.

Closes #22557
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.