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

Field stats: Index constraints should remove indices in the response if the field to evaluate is empty #14868

Merged
merged 1 commit into from Nov 23, 2015

Conversation

Projects
None yet
2 participants
@martijnvg
Member

martijnvg commented Nov 19, 2015

Index constraints should remove indices in the response if the field to evaluate if empty. Index constraints can't work with that and it is the same as if the field doesn't match.

@@ -119,18 +119,14 @@ protected FieldStatsResponse newResponse(FieldStatsRequest request, AtomicRefere
while (iterator.hasNext()) {
Map.Entry<String, Map<String, FieldStats>> entry = iterator.next();
FieldStats indexConstraintFieldStats = entry.getValue().get(indexConstraint.getField());
if (indexConstraintFieldStats == null) {

This comment has been minimized.

@bleskes

bleskes Nov 19, 2015

Member

if we want to filter this out, we should do it regardless of whether some have index constraints on that field, no?

@bleskes

bleskes Nov 19, 2015

Member

if we want to filter this out, we should do it regardless of whether some have index constraints on that field, no?

This comment has been minimized.

@martijnvg

martijnvg Nov 20, 2015

Member

We filter it if the index constraint doesn't match. If it is null it means that no document has a value for the index where the index constraint is defined for, so we filter it out too (it will never match with the index constraint)

@martijnvg

martijnvg Nov 20, 2015

Member

We filter it if the index constraint doesn't match. If it is null it means that no document has a value for the index where the index constraint is defined for, so we filter it out too (it will never match with the index constraint)

@bleskes

This comment has been minimized.

Show comment
Hide comment
@bleskes

bleskes Nov 19, 2015

Member

Wondering - what does it mean that an index response is empty? that it doesn't have the requested fields?

Member

bleskes commented Nov 19, 2015

Wondering - what does it mean that an index response is empty? that it doesn't have the requested fields?

@martijnvg

This comment has been minimized.

Show comment
Hide comment
@martijnvg

martijnvg Nov 20, 2015

Member

@bleskes The index constraint didn't match either because there was no data or it just didn't match. But returning an empty hash isn't useful, so that is why why the PR changes that.

Member

martijnvg commented Nov 20, 2015

@bleskes The index constraint didn't match either because there was no data or it just didn't match. But returning an empty hash isn't useful, so that is why why the PR changes that.

@bleskes

This comment has been minimized.

Show comment
Hide comment
@bleskes

bleskes Nov 20, 2015

Member

LGTM (though the description needs to be adapted)

Member

bleskes commented Nov 20, 2015

LGTM (though the description needs to be adapted)

@martijnvg martijnvg changed the title from [Field stats] Prune empty indices in response if indices constraints has no values to [Field stats] Index constraints shouldn't evaluate empty fields Nov 23, 2015

@martijnvg martijnvg changed the title from [Field stats] Index constraints shouldn't evaluate empty fields to [Field stats] Index constraints should remove indices in the response if the field to evaluate if empty Nov 23, 2015

field stats: Index constraints should remove indices in the response …
…if the field to evaluate s empty

Index constraints should remove indices in the response if the field to evaluate if empty. Index constraints can't work with that and it is the same as if the field doesn't match.

@martijnvg martijnvg changed the title from [Field stats] Index constraints should remove indices in the response if the field to evaluate if empty to [Field stats] Index constraints should remove indices in the response if the field to evaluate is empty Nov 23, 2015

@martijnvg martijnvg merged commit 4b94b50 into elastic:master Nov 23, 2015

1 check passed

CLA Commit author is a member of Elasticsearch
Details

@clintongormley clintongormley changed the title from [Field stats] Index constraints should remove indices in the response if the field to evaluate is empty to Field stats: Index constraints should remove indices in the response if the field to evaluate is empty Nov 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment