Adds ignore_unmapped option to nested and P/C queries#17748
Adds ignore_unmapped option to nested and P/C queries#17748colings86 merged 1 commit intoelastic:masterfrom colings86:enhance/ignoreUnmappedNestedPC
ignore_unmapped option to nested and P/C queries#17748Conversation
There was a problem hiding this comment.
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.
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)