-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Adds ignore_unmapped option to nested and P/C queries
#17748
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
Adds ignore_unmapped option to nested and P/C queries
#17748
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use expectThrows instead? I think we should use it rather than this try:fail/catch:check_msg pattern for new code.
|
A minor concern I have is that |
|
maybe we should name this setting |
|
I'm ok with changing it to |
|
|
|
Docs LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's put it on the next line to be consistent?
|
LGTM |
The change adds a new option to the `nested`, `has_parent`, `has_children` and `parent_id` queries: `ignore_unmapped`. If this option is set to false, the `toQuery` method on the QueryBuilder will throw an exception if the type/path specified in the query is unmapped. If the option is set to true, the `toQuery` method on the QueryBuilder will return a MatchNoDocsQuery. The default value is `false`so the queries work how they do today (throwing an exception on unmapped paths/types)
ignore_unmapped option to nested and P/C queries
The change adds a new option to the
nested,has_parent,has_childrenandparent_idqueries:ignore_unmapped. If this option is set to false, thetoQuerymethod on the QueryBuilder will throw an exception if the type/path specified in the query is unmapped. If the option is set to true, thetoQuerymethod on the QueryBuilder will return a MatchNoDocsQuery. The default value isfalseso the queries work how they do today (throwing an exception on unmapped paths/types)