-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add false_allow_templates as a dynamic mapping option #18825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gaobinlong
merged 16 commits into
opensearch-project:main
from
bruce-hong-glean:false-allow-dynamic-templates
Aug 13, 2025
Merged
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
82ee0eb
Starting work, untested
bruce-hong-glean 1c22da1
Merge branch 'main' into false-allow-dynamic-templates
bruce-hong-glean 249f59c
Rebase
bruce-hong-glean 7a2535e
Fix rest-api-spec:spotlessApply
bruce-hong-glean 528e8ac
Run :server:spotlessApply
bruce-hong-glean d759498
Improve test coverage
bruce-hong-glean 99b9365
Spotless apply
bruce-hong-glean 9a6762f
DRY-er
bruce-hong-glean 217a993
Spotless check
bruce-hong-glean 81ee151
Comments
bruce-hong-glean 5d883fe
Merge branch 'main' into false-allow-dynamic-templates
bruce-hong-glean d2f5f0a
Merge branch 'main' into false-allow-dynamic-templates
gaobinlong 36687c8
Merge branch 'main' into false-allow-dynamic-templates
gaobinlong 491da44
Comments
bruce-hong-glean 0eebef1
Merge branch 'false-allow-dynamic-templates' of https://github.com/br…
bruce-hong-glean a632fd3
Merge branch 'main' into false-allow-dynamic-templates
bruce-hong-glean File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
165 changes: 165 additions & 0 deletions
165
rest-api-spec/src/main/resources/rest-api-spec/test/index/111_false_allow_templates.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
gaobinlong marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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} | ||
gaobinlong marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - 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} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.