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

Search.count with post_filter throws error #518

Closed
hvdklauw opened this issue Nov 29, 2016 · 7 comments
Closed

Search.count with post_filter throws error #518

hvdklauw opened this issue Nov 29, 2016 · 7 comments

Comments

@hvdklauw
Copy link

Seems the check in Search.to_dict for the if count needs to be before it adds the post_filter.

In this case the post_filter is on a aggs.bucket which doesn't get added.

@honzakral
Copy link
Contributor

Thanks for the report. The question is whether we exclude the post_filter when doing count or throw a special exception. If we exclude it it might be confusing to people. What do you think?

@hvdklauw
Copy link
Author

hvdklauw commented Dec 9, 2016

My expectation was that it would simply exclude the post_filter for the count.

The whole point of the dsl is that you can add things to the query set, throwing an error at that point puts you in a unrecoverable situation.

Sure it might be unexpected that it throws away the post filter, but I it already throws away some other things from the query.

@honzakral
Copy link
Contributor

You are right, thanks for raising this issue, fix has been pushed to master.

@hvdklauw
Copy link
Author

Thanks! Cleaning up for the new year? ;-)

@yanyumiao
Copy link

I found the same problem with es v5.0.2, it give "request does not support [post_filter]", how to save this ?

@hvdklauw
Copy link
Author

hvdklauw commented Jul 4, 2017

Did you also upgrade the elasticsearch-dsl package?

@yanyumiao
Copy link

@hvdklauw
no I doesn't use python, I use http rest API
es v2.3.3 _count _search both support post_filter
but only _search support post_filter in es v5.0.2

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

3 participants