Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Prevent shard initialization failure due to streaming consumer errors ([#18877](https://github.com/opensearch-project/OpenSearch/pull/18877))
- APIs for stream transport and new stream-based search api action ([#18722](https://github.com/opensearch-project/OpenSearch/pull/18722))
- Added the core process for warming merged segments in remote-store enabled domains ([#18683](https://github.com/opensearch-project/OpenSearch/pull/18683))
- The dynamic mapping parameter supports false_allow_templates ([#18825](https://github.com/opensearch-project/OpenSearch/pull/18825))
- Streaming aggregation ([#18874](https://github.com/opensearch-project/OpenSearch/pull/18874))
- Optimize Composite Aggregations by removing unnecessary object allocations ([#18531](https://github.com/opensearch-project/OpenSearch/pull/18531))
- [Star-Tree] Add search support for ip field type ([#18671](https://github.com/opensearch-project/OpenSearch/pull/18671))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
---
"Index documents with setting dynamic parameter to false_allow_templates in the mapping of the index":
- skip:
version: " - 3.2.99"
reason: "introduced in 3.3.0"

- do:
indices.create:
index: test_1
body:
mappings:
dynamic: false_allow_templates
dynamic_templates: [
{
dates: {
"match": "date_*",
"match_mapping_type": "date",
"mapping": {
"type": "date"
}
}
},
{
strings: {
"match": "stringField*",
"match_mapping_type": "string",
"mapping": {
"type": "keyword"
}
}
},
{
object: {
"match": "objectField*",
"match_mapping_type": "object",
"mapping": {
"type": "object",
"properties": {
"bar1": {
"type": "keyword"
},
"bar2": {
"type": "text"
}
}
}
}
},
{
boolean: {
"match": "booleanField*",
"match_mapping_type": "boolean",
"mapping": {
"type": "boolean"
}
}
},
{
long: {
"match": "longField*",
"match_mapping_type": "long",
"mapping": {
"type": "long"
}
}
},
{
double: {
"match": "doubleField*",
"match_mapping_type": "double",
"mapping": {
"type": "double"
}
}
},
{
float: {
"match": "floatField*",
"match_mapping_type": "float",
"mapping": {
"type": "float"
}
}
},
{
integer: {
"match": "integerField*",
"match_mapping_type": "integer",
"mapping": {
"type": "integer"
}
}
},
{
array: {
"match": "arrayField*",
"mapping": {
"type": "keyword"
}
}
}
]
properties:
url:
type: keyword

- do:
index:
index: test_1
id: 1
body: {
url: "https://example.com",
date_timestamp: "2024-06-25T05:11:51.243Z",
stringField: "bar",
objectField: {
bar1: "bar1",
bar2: "bar2"
},
booleanField: true,
longField: 123456789,
doubleField: 123.456,
floatField: 123.45,
integerField: 12345,
arrayField: ["item1", "item2", "item3"],
author: "John Doe"
}

- do:
get:
index: test_1
id: 1
- match:
_source:
url: "https://example.com"
date_timestamp: "2024-06-25T05:11:51.243Z"
stringField: "bar"
objectField:
bar1: "bar1"
bar2: "bar2"
booleanField: true
longField: 123456789
doubleField: 123.456
floatField: 123.45
integerField: 12345
arrayField: ["item1", "item2", "item3"]
author: "John Doe"

- do:
indices.get_mapping:
index: test_1

- match: {test_1.mappings.dynamic: false_allow_templates}
- match: {test_1.mappings.properties.url.type: keyword}
- match: {test_1.mappings.properties.date_timestamp.type: date}
- match: {test_1.mappings.properties.stringField.type: keyword}
- match: {test_1.mappings.properties.objectField.properties.bar1.type: keyword}
- match: {test_1.mappings.properties.objectField.properties.bar2.type: text}
- match: {test_1.mappings.properties.booleanField.type: boolean}
- match: {test_1.mappings.properties.longField.type: long}
- match: {test_1.mappings.properties.doubleField.type: double}
- match: {test_1.mappings.properties.floatField.type: float}
- match: {test_1.mappings.properties.integerField.type: integer}
- match: {test_1.mappings.properties.arrayField.type: keyword}
- match: {test_1.mappings.properties.author: null}
- length: {test_1.mappings.properties: 11}
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,34 @@ setup:

- match: {test_index1.mappings.dynamic: strict_allow_templates}
- match: {test_index1.mappings.properties.test1.type: text}

---
"post a mapping with setting dynamic to false_allow_templates":
- skip:
version: " - 3.2.99"
reason: "introduced in 3.3.0"
- do:
indices.put_mapping:
index: test_index1
body:
dynamic: false_allow_templates
dynamic_templates: [
{
strings: {
"match": "foo*",
"match_mapping_type": "string",
"mapping": {
"type": "keyword"
}
}
}
]
properties:
test1:
type: text

- do:
indices.get_mapping: {}

- match: {test_index1.mappings.dynamic: false_allow_templates}
- match: {test_index1.mappings.properties.test1.type: text}
Loading
Loading