Skip to content

Commit

Permalink
Correct index mapping types
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Nov 12, 2024
1 parent ed5e83c commit 77ee7d7
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 143 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added Python and Ruby spec validators ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646))
- Added verbose output of the story being evaluated ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646))
- Added `_search` with `sort: direction` ([#658](https://github.com/opensearch-project/opensearch-api-specification/pull/658))
- Added `_common.mapping:FlatObjectProperty` ([#661](https://github.com/opensearch-project/opensearch-api-specification/pull/661))
- Added `_common.mapping:FlatObjectProperty` ([#661](https://github.com/opensearch-project/opensearch-api-specification/pull/661))
- Added `_common.mapping:IcuCollationKeywordProperty` ([#]())

### Removed
- Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652))
- Removed unsupported `_common.mapping:DenseVectorProperty`, `_common.mapping:SparseVectorProperty`, and `_common.mapping:FlattenedProperty` ([#]())
- Removed unsupported time series dimension properties and types ([#]())
- Removed unsupported runtime field properties (`script`/`on_script_error`) on `NumberPropertyBase` ([#]())

### Fixed
- Spec passes OpenAPI 3.1.0 validations ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646))
Expand Down
151 changes: 37 additions & 114 deletions spec/schemas/_common.mapping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@ components:
- $ref: '#/components/schemas/DateNanosProperty'
- $ref: '#/components/schemas/DateProperty'
- $ref: '#/components/schemas/AggregateMetricDoubleProperty'
- $ref: '#/components/schemas/DenseVectorProperty'
- $ref: '#/components/schemas/SparseVectorProperty'
- $ref: '#/components/schemas/FlattenedProperty'
- $ref: '#/components/schemas/FlatObjectProperty'
- $ref: '#/components/schemas/NestedProperty'
- $ref: '#/components/schemas/ObjectProperty'
Expand Down Expand Up @@ -158,6 +155,7 @@ components:
- $ref: '#/components/schemas/IpRangeProperty'
- $ref: '#/components/schemas/LongRangeProperty'
- $ref: '#/components/schemas/KnnVectorProperty'
- $ref: '#/components/schemas/IcuCollationKeywordProperty'
BinaryProperty:
allOf:
- $ref: '#/components/schemas/DocValuesPropertyBase'
Expand Down Expand Up @@ -227,19 +225,6 @@ components:
- boolean
required:
- type
OnScriptError:
type: string
enum:
- continue
- fail
TimeSeriesMetricType:
type: string
enum:
- counter
- gauge
- histogram
- position
- summary
IndexOptions:
type: string
enum:
Expand Down Expand Up @@ -310,9 +295,6 @@ components:
type: string
split_queries_on_whitespace:
type: boolean
time_series_dimension:
description: For internal use by OpenSearch only. Marks the field as a time series dimension. Defaults to false.
type: boolean
type:
type: string
enum:
Expand Down Expand Up @@ -535,86 +517,10 @@ components:
type: array
items:
type: string
time_series_metric:
$ref: '#/components/schemas/TimeSeriesMetricType'
required:
- default_metric
- metrics
- type
DenseVectorProperty:
allOf:
- $ref: '#/components/schemas/PropertyBase'
- type: object
properties:
type:
type: string
enum:
- dense_vector
dims:
type: number
similarity:
type: string
index:
type: boolean
index_options:
$ref: '#/components/schemas/DenseVectorIndexOptions'
required:
- dims
- type
DenseVectorIndexOptions:
type: object
properties:
type:
type: string
m:
type: number
ef_construction:
type: number
required:
- ef_construction
- m
- type
SparseVectorProperty:
allOf:
- $ref: '#/components/schemas/PropertyBase'
- type: object
properties:
type:
type: string
enum:
- sparse_vector
required:
- type
FlattenedProperty:
allOf:
- $ref: '#/components/schemas/PropertyBase'
- type: object
properties:
boost:
type: number
format: double
depth_limit:
type: number
doc_values:
type: boolean
eager_global_ordinals:
type: boolean
index:
type: boolean
index_options:
$ref: '#/components/schemas/IndexOptions'
null_value:
type: string
similarity:
type: string
split_queries_on_whitespace:
type: boolean
type:
type: string
enum:
- flattened
required:
- type
FlatObjectProperty:
allOf:
- $ref: '#/components/schemas/PropertyBase'
Expand Down Expand Up @@ -751,13 +657,6 @@ components:
type: boolean
null_value:
type: string
on_script_error:
$ref: '#/components/schemas/OnScriptError'
script:
$ref: '_common.yaml#/components/schemas/Script'
time_series_dimension:
description: For internal use by OpenSearch only. Marks the field as a time series dimension. Defaults to false.
type: boolean
type:
type: string
enum:
Expand Down Expand Up @@ -843,20 +742,22 @@ components:
- type
GeoOrientation:
oneOf:
# eslint-disable yml/sort-sequence-values
- title: left
type: string
enum:
- left
- LEFT
- clockwise
- cw
- left
- title: right
type: string
enum:
- right
- RIGHT
- ccw
- counterclockwise
- right
- ccw
# eslint-enable yml/sort-sequence-values
GeoStrategy:
type: string
enum:
Expand Down Expand Up @@ -927,15 +828,6 @@ components:
type: boolean
index:
type: boolean
on_script_error:
$ref: '#/components/schemas/OnScriptError'
script:
$ref: '_common.yaml#/components/schemas/Script'
time_series_metric:
$ref: '#/components/schemas/TimeSeriesMetricType'
time_series_dimension:
description: For internal use by OpenSearch only. Marks the field as a time series dimension. Defaults to false.
type: boolean
DoubleNumberProperty:
allOf:
- $ref: '#/components/schemas/NumberPropertyBase'
Expand Down Expand Up @@ -1168,6 +1060,37 @@ components:
required:
- dimension
- type
IcuCollationKeywordProperty:
allOf:
- $ref: '#/components/schemas/DocValuesPropertyBase'
- type: object
properties:
type:
type: string
enum:
- icu_collation_keyword
index:
type: boolean
null_value:
type: string
alternate:
$ref: '_common.analysis.yaml#/components/schemas/IcuCollationAlternate'
case_level:
type: boolean
case_first:
$ref: '_common.analysis.yaml#/components/schemas/IcuCollationCaseFirst'
decomposition:
$ref: '_common.analysis.yaml#/components/schemas/IcuCollationDecomposition'
hiragana_quaternary_mode:
type: boolean
numeric:
type: boolean
strength:
$ref: '_common.analysis.yaml#/components/schemas/IcuCollationStrength'
variable_top:
type: string
required:
- type
MatchType:
type: string
enum:
Expand Down
19 changes: 0 additions & 19 deletions spec/schemas/_core.field_caps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,6 @@ components:
metadata_field:
description: Whether this field is registered as a metadata field.
type: boolean
time_series_dimension:
description: Whether this field is used as a time series dimension.
type: boolean
time_series_metric:
$ref: '_common.mapping.yaml#/components/schemas/TimeSeriesMetricType'
non_dimension_indices:
description: |-
If this list is present in the response, then indexes not contained in the list have the
field marked as a dimension. Any indexes contained in the list are not marked as a dimension.
type: array
items:
$ref: '_common.yaml#/components/schemas/IndexName'
metric_conflicts_indices:
description: |-
The list of indexes in which this field is present if the indexes
don't have the same `time_series_metric` value for the field.
type: array
items:
$ref: '_common.yaml#/components/schemas/IndexName'
required:
- aggregatable
- searchable
Expand Down
9 changes: 0 additions & 9 deletions spec/schemas/indices._common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ components:
$ref: '#/components/schemas/IndexSettingsAnalysis'
settings:
$ref: '#/components/schemas/IndexSettings'
time_series:
$ref: '#/components/schemas/IndexSettingsTimeSeries'
queries:
$ref: '#/components/schemas/IndexSettingsQueries'
similarity:
Expand Down Expand Up @@ -457,13 +455,6 @@ components:
type: object
additionalProperties:
$ref: '_common.analysis.yaml#/components/schemas/Tokenizer'
IndexSettingsTimeSeries:
type: object
properties:
end_time:
$ref: '_common.yaml#/components/schemas/DateTime'
start_time:
$ref: '_common.yaml#/components/schemas/DateTime'
IndexSettingsQueries:
type: object
properties:
Expand Down

0 comments on commit 77ee7d7

Please sign in to comment.