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

Don't default "Min Doc Count" to 0 for Elasticsearch terms aggregation #8321

Closed
volter opened this issue May 8, 2017 · 1 comment
Closed

Comments

@volter
Copy link
Contributor

volter commented May 8, 2017

min_doc_count defaults to 0 and this is usually not what you want. If you set up the following query, the results may surprise you:

host:myhost

Now add a terms aggregation for host. The result will look a bit like this:

myhost: 2, unrelated: 0, also_unrelated:0, ...

ES' default for min_doc_count is actually 1, to avoid this effect, since terms aggregations don't work like group-bys in SQL. I therefore recommend to default it to 1 and possibly don't allow 0 at all.

I also suggest to default to a "Top" query instead of a "Bottom" query, like I did before. :)

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

No branches or pull requests

4 participants