Skip to content

Commit

Permalink
update with accurate numeric type for common, core (#612)
Browse files Browse the repository at this point in the history
* update with accurate numeric type for common, core

Signed-off-by: amberzsy <[email protected]>

* add changelog

Signed-off-by: amberzsy <[email protected]>

* update explian value field with 'General Number'

Signed-off-by: amberzsy <[email protected]>

---------

Signed-off-by: amberzsy <[email protected]>
  • Loading branch information
amberzsy authored Oct 14, 2024
1 parent 5dc65a5 commit 051c21d
Show file tree
Hide file tree
Showing 7 changed files with 244 additions and 105 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fixed create/delete/index operation in `_bulk` ([#582](https://github.com/opensearch-project/opensearch-api-specification/pull/582))
- Add `mode` and `compression` to k-NN index creation and search, and add `rescore` and `oversample_factor` to k-NN search ([#588](https://github.com/opensearch-project/opensearch-api-specification/pull/588))
- Fixed `/{index}/_search` with aggregations ([#576](https://github.com/opensearch-project/opensearch-api-specification/pull/576))
- Fixed inaccurate numeric type ([#597](https://github.com/opensearch-project/opensearch-api-specification/pull/597))([#598](https://github.com/opensearch-project/opensearch-api-specification/pull/598))([#600](https://github.com/opensearch-project/opensearch-api-specification/pull/600))
- Fixed inaccurate numeric type ([#597](https://github.com/opensearch-project/opensearch-api-specification/pull/597))([#598](https://github.com/opensearch-project/opensearch-api-specification/pull/598))([#600](https://github.com/opensearch-project/opensearch-api-specification/pull/600))([#612](https://github.com/opensearch-project/opensearch-api-specification/pull/612))
- Fixed mapping and analysis types ([#600](https://github.com/opensearch-project/opensearch-api-specification/pull/600))
- Fixed `RestStatus` responses in `DELETE /_plugins/_notifications/configs/{config_id}` ([#594](https://github.com/opensearch-project/opensearch-api-specification/pull/594))
- Fixed `GET /_snapshot_/{repository}/{snapshot}` ([#608](https://github.com/opensearch-project/opensearch-api-specification/pull/608))
Expand Down
3 changes: 2 additions & 1 deletion spec/schemas/_common.query_dsl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1824,7 +1824,8 @@ components:
description: Can only be used as a clause in a span_near query.
type: object
additionalProperties:
type: number
type: integer
format: int32
minProperties: 1
maxProperties: 1
SpanMultiTermQuery:
Expand Down
65 changes: 47 additions & 18 deletions spec/schemas/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,20 @@ components:
type: object
properties:
1xx:
type: number
type: integer
format: int32
2xx:
type: number
type: integer
format: int32
3xx:
type: number
type: integer
format: int32
4xx:
type: number
type: integer
format: int32
5xx:
type: number
type: integer
format: int32
Duration:
description: |-
A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and
Expand Down Expand Up @@ -162,6 +167,7 @@ components:
type: array
items:
type: number
format: double
- title: text
type: string
XyCartesianCoordinates:
Expand All @@ -171,9 +177,11 @@ components:
x:
description: The x coordinate.
type: number
format: double
y:
description: The y coordinate.
type: number
format: double
required:
- x
- y
Expand Down Expand Up @@ -239,24 +247,31 @@ components:
type: array
items:
type: number
format: double
required:
- coordinates
- type
ClusterStatistics:
type: object
properties:
skipped:
type: number
type: integer
format: int32
successful:
type: number
type: integer
format: int32
total:
type: number
type: integer
format: int32
running:
type: number
type: integer
format: int32
partial:
type: number
type: integer
format: int32
failed:
type: number
type: integer
format: int32
details:
type: object
additionalProperties:
Expand Down Expand Up @@ -438,7 +453,8 @@ components:
MinimumShouldMatch:
description: The minimum number of terms that should match as an integer, percentage, or range.
oneOf:
- type: number
- type: integer
format: int32
- type: string
Distance:
type: string
Expand Down Expand Up @@ -512,7 +528,8 @@ components:
Fuzziness:
oneOf:
- type: string
- type: number
- type: integer
format: int32
GeoDistanceType:
type: string
enum:
Expand Down Expand Up @@ -631,6 +648,7 @@ components:
$ref: '_common.query_dsl.yaml#/components/schemas/QueryContainer'
max_children:
type: integer
format: int32
nested:
$ref: '#/components/schemas/NestedSortValue'
path:
Expand Down Expand Up @@ -669,7 +687,8 @@ components:
GeoHashPrecision:
description: The level of geohash precision, which can be expressed as a geohash length between 1 and 12 or as a distance measure, such as "1km" or "10m".
oneOf:
- type: number
- type: integer
format: int32
- type: string
GeoTilePrecision:
type: number
Expand All @@ -682,14 +701,17 @@ components:
$ref: '#/components/schemas/QueryVector'
k:
description: The total number of nearest neighbors to return as top hits.
type: number
type: integer
format: int32
min_score:
description: The minimum similarity score required in order for a neighbor to be considered a hit.
type: number
format: float
x-version-added: '2.14'
max_distance:
description: The maximum physical vector space distance required in order for a neighbor to be considered a hit.
type: number
format: float
x-version-added: '2.14'
filter:
description: The filters for the k-NN search query.
Expand All @@ -701,22 +723,26 @@ components:
boost:
description: The boost value applied to k-NN scores.
type: number
format: float
method_parameters:
type: object
x-version-added: '2.16'
additionalProperties:
type: number
type: integer
format: int32
rescore:
type: object
x-version-added: '2.17'
additionalProperties:
type: number
format: float
required:
- vector
QueryVector:
type: array
items:
type: number
format: float
SlicedScroll:
type: object
properties:
Expand All @@ -725,7 +751,8 @@ components:
id:
$ref: '#/components/schemas/Id'
max:
type: number
type: integer
format: int32
required:
- id
- max
Expand Down Expand Up @@ -758,7 +785,8 @@ components:
_seq_no:
$ref: '#/components/schemas/SequenceNumber'
_primary_term:
type: number
type: integer
format: int32
_routing:
$ref: '#/components/schemas/Routing'
_source:
Expand Down Expand Up @@ -802,6 +830,7 @@ components:
format: int64
PercentageNumber:
type: number
format: double
PercentageString:
type: string
pattern: '\d+(\.\d+)?'
Expand Down
12 changes: 8 additions & 4 deletions spec/schemas/_core.bulk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ components:
routing:
$ref: '_common.yaml#/components/schemas/Routing'
if_primary_term:
type: number
type: integer
format: int64
if_seq_no:
$ref: '_common.yaml#/components/schemas/SequenceNumber'
version:
Expand All @@ -71,7 +72,8 @@ components:
description: When `true`, the request's actions must target an index alias.
type: boolean
retry_on_conflict:
type: number
type: integer
format: int32
DeleteOperation:
$ref: '#/components/schemas/OperationBase'
UpdateAction:
Expand Down Expand Up @@ -117,12 +119,14 @@ components:
type: string
status:
description: HTTP status code returned for the operation.
type: number
type: integer
format: int32
error:
$ref: '_common.yaml#/components/schemas/ErrorCause'
_primary_term:
description: The primary term assigned to the document for the operation.
type: number
type: integer
format: int64
result:
description: |-
Result of the operation.
Expand Down
20 changes: 18 additions & 2 deletions spec/schemas/_core.explain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ components:
items:
$ref: '#/components/schemas/ExplanationDetail'
value:
type: number
oneOf:
- type: integer
format: int32
- type: integer
format: int64
- type: number
format: float
- type: number
format: double
required:
- description
- details
Expand All @@ -31,7 +39,15 @@ components:
items:
$ref: '#/components/schemas/ExplanationDetail'
value:
type: number
oneOf:
- type: integer
format: int32
- type: integer
format: int64
- type: number
format: float
- type: number
format: double
required:
- description
- value
Loading

0 comments on commit 051c21d

Please sign in to comment.