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

Values in filter terms being ignored during aggregation #25949

Closed
giudicelli opened this issue Jul 28, 2017 · 1 comment
Closed

Values in filter terms being ignored during aggregation #25949

giudicelli opened this issue Jul 28, 2017 · 1 comment

Comments

@giudicelli
Copy link

giudicelli commented Jul 28, 2017

Elasticsearch version: 2.4.5

Plugins installed: none

JVM version:
java version "1.8.0_73"
Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)

OS version :
Linux XXXX 3.14.32-xxxx-grs-ipv6-64 #9 SMP Thu Oct 20 14:53:52 CEST 2016 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:
When using a reference in "terms" for the "_uid" field in an aggregation, the filter is being ignored.
However, when using the same filter on a normal search, the filter is being honored.

Steps to reproduce:
Create an index and a type holding in a field a list of _uid, in my case the field holds over 50k uids.
Run an aggregation filtering on this list of _uid.
The filter is being ignored, and aggregation is ran on every entry...

Example:
{ "size":0, "filter":{ "terms":{ "_uid":{ "index":"CACHE_INDEX", "type":"Cache", "id":"CacheId", "path":"UIDSList" } } }, "aggs":{ "counter":{ "date_histogram":{ "field":"DateField", "interval":"day", "missing":0, "time_zone":"+02:00" } } } }

The queried type was created with the following meta parameters:
{ "_all" : {"enabled" : false}, "date_detection": false, "dynamic": "strict", "properties": { ... } }

@rjernst
Copy link
Member

rjernst commented Jul 31, 2017

Please ask questions on our forum. We use github for feature requests and confirmed bug reports.

Your _uid there is not a value, it is an object, and I suspect lacked validation in 2.x. Validation is much better in 5.0+ since The Great Query Refactoring.

@rjernst rjernst closed this as completed Jul 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants