Skip to content

Commit 9e0528f

Browse files
authored
Revert "Add false_allow_templates as a dynamic mapping option (#10388)" (#10659)
This reverts commit 9472bf8.
1 parent 429cb3a commit 9e0528f

File tree

3 files changed

+2
-73
lines changed

3 files changed

+2
-73
lines changed

_field-types/mapping-parameters/dynamic.md

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -344,73 +344,3 @@ PUT testindex1/_doc/1
344344
"floor": "1"
345345
}
346346
```
347-
348-
---
349-
350-
## Example: Create an index with `dynamic` set to `false_allow_templates`
351-
352-
1. Create an index with predefined dynamic templates and `dynamic` set to `false_allow_templates` by sending the following request:
353-
354-
```json
355-
PUT testindex1
356-
{
357-
"mappings": {
358-
"dynamic": "false_allow_templates",
359-
"dynamic_templates": [
360-
{
361-
"strings": {
362-
"match": "room*",
363-
"match_mapping_type": "string",
364-
"mapping": {
365-
"type": "keyword"
366-
}
367-
}
368-
}
369-
],
370-
"properties": {
371-
"patient": {
372-
"properties": {
373-
"id": {
374-
"type": "keyword"
375-
},
376-
"name": {
377-
"type": "keyword"
378-
}
379-
}
380-
}
381-
}
382-
}
383-
}
384-
```
385-
{% include copy-curl.html %}
386-
387-
2. Index a document with an object field `patient` containing two string fields and a new field `room` that matches one of the dynamic templates by sending the following request:
388-
389-
```json
390-
PUT testindex1/_doc/1
391-
{
392-
"patient": {
393-
"name" : "John Doe",
394-
"id" : "123456"
395-
},
396-
"room": "room1"
397-
}
398-
```
399-
{% include copy-curl.html %}
400-
401-
The new field `room` is indexed because it matches the dynamic templates.
402-
403-
If you add a new field `floor`, it is indexed even though it does not match any mapping properties or dynamic templates. However, mappings are not created for the `floor` field. Thus, queries such as `{"match": {"floor": "1"}}` do not return this document:
404-
405-
```json
406-
PUT testindex1/_doc/1
407-
{
408-
"patient": {
409-
"name" : "John Doe",
410-
"id" : "123456"
411-
},
412-
"room": "room1",
413-
"floor": "1"
414-
}
415-
```
416-
{% include copy-curl.html %}

_field-types/supported-field-types/nested.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ The following table lists the parameters accepted by object field types. All par
310310

311311
Parameter | Description
312312
:--- | :---
313-
[`dynamic`]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/object#the-dynamic-parameter) | Specifies whether new fields can be dynamically added to the object. Valid values are `true`, `false`, `strict`, `strict_allow_templates`, and `false_allow_templates`. Default is `true`.
313+
[`dynamic`]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/object#the-dynamic-parameter) | Specifies whether new fields can be dynamically added to the object. Valid values are `true`, `false`, `strict`, and `strict_allow_templates`. Default is `true`.
314314
`include_in_parent` | A Boolean value that specifies whether all fields in the child nested object should also be added to the parent document in flattened form. Default is `false`.
315315
`include_in_root` | A Boolean value that specifies whether all fields in the child nested object should also be added to the root document in flattened form. Default is `false`.
316316
`properties` | Fields of this object, which can be of any supported type. New properties can be dynamically added to this object if `dynamic` is set to `true`.

_field-types/supported-field-types/object.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ The following table lists the parameters accepted by object field types. All par
7575

7676
Parameter | Description
7777
:--- | :---
78-
[`dynamic`](#the-dynamic-parameter) | Specifies whether new fields can be dynamically added to the object. Valid values are `true`, `false`, `strict`, `strict_allow_templates`, and `false_allow_templates`. Default is `true`.
78+
[`dynamic`](#the-dynamic-parameter) | Specifies whether new fields can be dynamically added to the object. Valid values are `true`, `false`, `strict`, and `strict_allow_templates`. Default is `true`.
7979
`enabled` | A Boolean value that specifies whether the JSON contents of the object should be parsed. If `enabled` is set to `false`, the object's contents are not indexed or searchable, but they are still retrievable from the _source field. Default is `true`.
8080
`properties` | Fields of this object, which can be of any supported type. New properties can be dynamically added to this object if `dynamic` is set to `true`.
8181

@@ -152,7 +152,6 @@ Value | Description
152152
`false` | New fields cannot be added to the mapping dynamically. If a new field is detected, it is not indexed or searchable. However, it is still retrievable from the _source field.
153153
`strict` | When new fields are added to the mapping dynamically, an exception is thrown. To add a new field to an object, you have to add it to the mapping first.
154154
`strict_allow_templates` | If the newly detected fields match any of the predefined dynamic templates in the mapping, then they are added to the mapping; if they do not match any of them, then an exception is thrown.
155-
`false_allow_templates` | If the newly detected fields match any of the predefined dynamic templates in the mapping, then they are added to the mapping. Only fields matching dynamic templates or mapping properties are indexed.
156155

157156
Inner objects inherit the `dynamic` parameter value from their parent unless they declare their own `dynamic` parameter value.
158157
{: .note }

0 commit comments

Comments
 (0)