Skip to content

Commit 1285cbe

Browse files
authored
FunctionScore Schema Update (#963)
* Change DecayFunction anyOf to oneOf Signed-off-by: xil <[email protected]> * Add NumberRangeQuery & DateRangeQuery missing field include_lower & include_upper Signed-off-by: xil <[email protected]> * Add missing unit to GeoDistanceQuery Signed-off-by: xil <[email protected]> * update seed Signed-off-by: xil <[email protected]> --------- Signed-off-by: xil <[email protected]> Signed-off-by: lucy66hw <[email protected]>
1 parent c7f7cff commit 1285cbe

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
330330
- Changed `indices.stats`'s `metric` path param to use an enum of metrics ([#586](https://github.com/opensearch-project/opensearch-api-specification/pull/586))
331331
- Changed `CleanupRepositoryResults`' properties to be `int64`s ([#587](https://github.com/opensearch-project/opensearch-api-specification/pull/587))
332332
- Changed `RangeQuery` to unified type with oneOf ([#958](https://github.com/opensearch-project/opensearch-api-specification/pull/958))
333+
- Changed `FunctionScore` related Schema ([#963](https://github.com/opensearch-project/opensearch-api-specification/pull/963))
333334
- Changed `sort` from `SortOptions` to `SortCombinations` ([#961](https://github.com/opensearch-project/opensearch-api-specification/pull/961))
334335

335336
### Deprecated

spec/schemas/_common.query_dsl.yaml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ components:
546546
- min
547547
- sum
548548
DecayPlacement:
549-
anyOf:
549+
oneOf:
550550
- $ref: '#/components/schemas/DateDecayPlacement'
551551
- $ref: '#/components/schemas/GeoDecayPlacement'
552552
- $ref: '#/components/schemas/NumericDecayPlacement'
@@ -562,6 +562,8 @@ components:
562562
$ref: '_common.yaml#/components/schemas/DateTime'
563563
scale:
564564
$ref: '_common.yaml#/components/schemas/Duration'
565+
required:
566+
- scale
565567
GeoDecayPlacement:
566568
type: object
567569
properties:
@@ -574,6 +576,9 @@ components:
574576
$ref: '_common.yaml#/components/schemas/GeoLocation'
575577
scale:
576578
$ref: '_common.yaml#/components/schemas/Distance'
579+
required:
580+
- origin
581+
- scale
577582
NumericDecayPlacement:
578583
type: object
579584
properties:
@@ -589,6 +594,9 @@ components:
589594
scale:
590595
type: number
591596
format: double
597+
required:
598+
- origin
599+
- scale
592600
FieldValueFactorScoreFunction:
593601
type: object
594602
properties:
@@ -630,6 +638,8 @@ components:
630638
oneOf:
631639
- type: integer
632640
format: int32
641+
- type: integer
642+
format: int64
633643
- type: string
634644
ScriptScoreFunction:
635645
type: object
@@ -723,6 +733,9 @@ components:
723733
$ref: '#/components/schemas/GeoValidationMethod'
724734
ignore_unmapped:
725735
$ref: '#/components/schemas/IgnoreUnmapped'
736+
unit:
737+
description: The unit of distance measurement.
738+
$ref: '_common.yaml#/components/schemas/DistanceUnit'
726739
propertyNames:
727740
title: field
728741
type: string
@@ -1698,6 +1711,12 @@ components:
16981711
$ref: '_common.yaml#/components/schemas/DateFormat'
16991712
time_zone:
17001713
$ref: '_common.yaml#/components/schemas/TimeZone'
1714+
include_lower:
1715+
description: Include the lower bound
1716+
type: boolean
1717+
include_upper:
1718+
description: Include the upper bound
1719+
type: boolean
17011720
NumberRangeQuery:
17021721
allOf:
17031722
- $ref: '#/components/schemas/RangeQueryBase'
@@ -1731,6 +1750,12 @@ components:
17311750
format: double
17321751
- type: string
17331752
- type: 'null'
1753+
include_lower:
1754+
description: Include the lower bound
1755+
type: boolean
1756+
include_upper:
1757+
description: Include the upper bound
1758+
type: boolean
17341759
RangeQueryBase:
17351760
allOf:
17361761
- $ref: '#/components/schemas/QueryBase'

0 commit comments

Comments
 (0)