Skip to content

Commit

Permalink
Refactor the common query DSL spec to extract IgnoreUnmapped (#515)
Browse files Browse the repository at this point in the history
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
  • Loading branch information
kolchfa-aws committed Aug 19, 2024
1 parent 52ec375 commit f9e2701
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions spec/schemas/_common.query_dsl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,12 @@ components:
- type: boolean
required:
- value
IgnoreUnmapped:
type: boolean
default: false
description: |-
Set to `true` to ignore an unmapped field and not match any documents for this query.
Set to `false` to throw an exception if the field is not mapped.
GeoBoundingBoxQuery:
allOf:
- $ref: '#/components/schemas/QueryBase'
Expand All @@ -603,10 +609,7 @@ components:
validation_method:
$ref: '#/components/schemas/GeoValidationMethod'
ignore_unmapped:
description: |-
Set to `true` to ignore an unmapped field and not match any documents for this query.
Set to `false` to throw an exception if the field is not mapped.
type: boolean
$ref: '#/components/schemas/IgnoreUnmapped'
GeoExecution:
type: string
enum:
Expand All @@ -630,11 +633,7 @@ components:
validation_method:
$ref: '#/components/schemas/GeoValidationMethod'
ignore_unmapped:
description: |-
Set to `true` to ignore an unmapped field and not match any documents for this query.
Set to `false` to throw an exception if the field is not mapped.
type: boolean
default: false
$ref: '#/components/schemas/IgnoreUnmapped'
field:
type: object
required:
Expand All @@ -648,25 +647,22 @@ components:
validation_method:
$ref: '#/components/schemas/GeoValidationMethod'
ignore_unmapped:
type: boolean
$ref: '#/components/schemas/IgnoreUnmapped'
GeoShapeQuery:
allOf:
- $ref: '#/components/schemas/QueryBase'
- type: object
properties:
ignore_unmapped:
description: |-
Set to `true` to ignore an unmapped field and not match any documents for this query.
Set to `false` to throw an exception if the field is not mapped.
type: boolean
$ref: '#/components/schemas/IgnoreUnmapped'
HasChildQuery:
allOf:
- $ref: '#/components/schemas/QueryBase'
- type: object
properties:
ignore_unmapped:
$ref: '#/components/schemas/IgnoreUnmapped'
description: Indicates whether to ignore an unmapped `type` and not return any documents instead of an error.
type: boolean
inner_hits:
$ref: '_core.search.yaml#/components/schemas/InnerHits'
max_children:
Expand Down Expand Up @@ -714,10 +710,10 @@ components:
- type: object
properties:
ignore_unmapped:
$ref: '#/components/schemas/IgnoreUnmapped'
description: |-
Indicates whether to ignore an unmapped `parent_type` and not return any documents instead of an error.
You can use this parameter to query multiple indices that may not contain the `parent_type`.
type: boolean
inner_hits:
$ref: '_core.search.yaml#/components/schemas/InnerHits'
parent_type:
Expand Down Expand Up @@ -1211,8 +1207,8 @@ components:
- type: object
properties:
ignore_unmapped:
$ref: '#/components/schemas/IgnoreUnmapped'
description: Indicates whether to ignore an unmapped path and not return any documents instead of an error.
type: boolean
inner_hits:
$ref: '_core.search.yaml#/components/schemas/InnerHits'
path:
Expand Down Expand Up @@ -1256,8 +1252,8 @@ components:
id:
$ref: '_common.yaml#/components/schemas/Id'
ignore_unmapped:
$ref: '#/components/schemas/IgnoreUnmapped'
description: Indicates whether to ignore an unmapped `type` and not return any documents instead of an error.
type: boolean
type:
$ref: '_common.yaml#/components/schemas/RelationName'
PercolateQuery:
Expand Down Expand Up @@ -1611,8 +1607,7 @@ components:
- type: object
properties:
ignore_unmapped:
description: When set to `true` the query ignores an unmapped field and will not match any documents.
type: boolean
$ref: '#/components/schemas/IgnoreUnmapped'
SimpleQueryStringQuery:
allOf:
- $ref: '#/components/schemas/QueryBase'
Expand Down

0 comments on commit f9e2701

Please sign in to comment.