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

If FunctionScore does not have any functions breaks query #36

Closed
martiis opened this issue Nov 25, 2015 · 5 comments
Closed

If FunctionScore does not have any functions breaks query #36

martiis opened this issue Nov 25, 2015 · 5 comments

Comments

@martiis
Copy link
Contributor

martiis commented Nov 25, 2015

No description provided.

@asev asev added the bug label Dec 4, 2015
@asev asev self-assigned this Dec 4, 2015
@asev
Copy link
Contributor

asev commented Dec 7, 2015

The same is with empty bool query, empty filtered query and other queries that behaviour is defined through setters (not constructor).
At this moment elasticsearch itself throws quite readable error in such cases (of course with all query dumped in the error).

It is open for discussion if ElasticsearchDSL should validate these queries.

@murnieza
Copy link
Contributor

murnieza commented Dec 7, 2015

I think that it could be too much effort to maintain all possible cases when this could happen.

@murnieza
Copy link
Contributor

murnieza commented Dec 8, 2015

@saimaz, @mvar what's your opinion?

@saimaz
Copy link
Member

saimaz commented Dec 8, 2015

That would be a massive responsibility to validate whole queries. We cannot validate one scenario, so it's all or none. The exception in query if there is no function set coud be a solution for better error handling, but as I said previosly, query validation we should take very carefully.

@saimaz
Copy link
Member

saimaz commented Dec 16, 2015

After long discussions and investigation. We believe that query structure validation is currently not a DSL responsibility. We simply providing a way to generate an array in objective perspective by asuming the user knows what he is writing.

Query validation should be performed in the native client as lowest part in the chain.

@saimaz saimaz closed this as completed Dec 16, 2015
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