|
| 1 | +--- |
| 2 | +"Index documents with setting dynamic parameter to false_allow_templates in the mapping of the index": |
| 3 | + - skip: |
| 4 | + version: " - 3.2.99" |
| 5 | + reason: "introduced in 3.3.0" |
| 6 | + |
| 7 | + - do: |
| 8 | + indices.create: |
| 9 | + index: test_1 |
| 10 | + body: |
| 11 | + mappings: |
| 12 | + dynamic: false_allow_templates |
| 13 | + dynamic_templates: [ |
| 14 | + { |
| 15 | + dates: { |
| 16 | + "match": "date_*", |
| 17 | + "match_mapping_type": "date", |
| 18 | + "mapping": { |
| 19 | + "type": "date" |
| 20 | + } |
| 21 | + } |
| 22 | + }, |
| 23 | + { |
| 24 | + strings: { |
| 25 | + "match": "stringField*", |
| 26 | + "match_mapping_type": "string", |
| 27 | + "mapping": { |
| 28 | + "type": "keyword" |
| 29 | + } |
| 30 | + } |
| 31 | + }, |
| 32 | + { |
| 33 | + object: { |
| 34 | + "match": "objectField*", |
| 35 | + "match_mapping_type": "object", |
| 36 | + "mapping": { |
| 37 | + "type": "object", |
| 38 | + "properties": { |
| 39 | + "bar1": { |
| 40 | + "type": "keyword" |
| 41 | + }, |
| 42 | + "bar2": { |
| 43 | + "type": "text" |
| 44 | + } |
| 45 | + } |
| 46 | + } |
| 47 | + } |
| 48 | + }, |
| 49 | + { |
| 50 | + boolean: { |
| 51 | + "match": "booleanField*", |
| 52 | + "match_mapping_type": "boolean", |
| 53 | + "mapping": { |
| 54 | + "type": "boolean" |
| 55 | + } |
| 56 | + } |
| 57 | + }, |
| 58 | + { |
| 59 | + long: { |
| 60 | + "match": "longField*", |
| 61 | + "match_mapping_type": "long", |
| 62 | + "mapping": { |
| 63 | + "type": "long" |
| 64 | + } |
| 65 | + } |
| 66 | + }, |
| 67 | + { |
| 68 | + double: { |
| 69 | + "match": "doubleField*", |
| 70 | + "match_mapping_type": "double", |
| 71 | + "mapping": { |
| 72 | + "type": "double" |
| 73 | + } |
| 74 | + } |
| 75 | + }, |
| 76 | + { |
| 77 | + float: { |
| 78 | + "match": "floatField*", |
| 79 | + "match_mapping_type": "float", |
| 80 | + "mapping": { |
| 81 | + "type": "float" |
| 82 | + } |
| 83 | + } |
| 84 | + }, |
| 85 | + { |
| 86 | + integer: { |
| 87 | + "match": "integerField*", |
| 88 | + "match_mapping_type": "integer", |
| 89 | + "mapping": { |
| 90 | + "type": "integer" |
| 91 | + } |
| 92 | + } |
| 93 | + }, |
| 94 | + { |
| 95 | + array: { |
| 96 | + "match": "arrayField*", |
| 97 | + "mapping": { |
| 98 | + "type": "keyword" |
| 99 | + } |
| 100 | + } |
| 101 | + } |
| 102 | + ] |
| 103 | + properties: |
| 104 | + url: |
| 105 | + type: keyword |
| 106 | + |
| 107 | + - do: |
| 108 | + index: |
| 109 | + index: test_1 |
| 110 | + id: 1 |
| 111 | + body: { |
| 112 | + url: "https://example.com", |
| 113 | + date_timestamp: "2024-06-25T05:11:51.243Z", |
| 114 | + stringField: "bar", |
| 115 | + objectField: { |
| 116 | + bar1: "bar1", |
| 117 | + bar2: "bar2" |
| 118 | + }, |
| 119 | + booleanField: true, |
| 120 | + longField: 123456789, |
| 121 | + doubleField: 123.456, |
| 122 | + floatField: 123.45, |
| 123 | + integerField: 12345, |
| 124 | + arrayField: ["item1", "item2", "item3"], |
| 125 | + author: "John Doe" |
| 126 | + } |
| 127 | + |
| 128 | + - do: |
| 129 | + get: |
| 130 | + index: test_1 |
| 131 | + id: 1 |
| 132 | + - match: |
| 133 | + _source: |
| 134 | + url: "https://example.com" |
| 135 | + date_timestamp: "2024-06-25T05:11:51.243Z" |
| 136 | + stringField: "bar" |
| 137 | + objectField: |
| 138 | + bar1: "bar1" |
| 139 | + bar2: "bar2" |
| 140 | + booleanField: true |
| 141 | + longField: 123456789 |
| 142 | + doubleField: 123.456 |
| 143 | + floatField: 123.45 |
| 144 | + integerField: 12345 |
| 145 | + arrayField: ["item1", "item2", "item3"] |
| 146 | + author: "John Doe" |
| 147 | + |
| 148 | + - do: |
| 149 | + indices.get_mapping: |
| 150 | + index: test_1 |
| 151 | + |
| 152 | + - match: {test_1.mappings.dynamic: false_allow_templates} |
| 153 | + - match: {test_1.mappings.properties.url.type: keyword} |
| 154 | + - match: {test_1.mappings.properties.date_timestamp.type: date} |
| 155 | + - match: {test_1.mappings.properties.stringField.type: keyword} |
| 156 | + - match: {test_1.mappings.properties.objectField.properties.bar1.type: keyword} |
| 157 | + - match: {test_1.mappings.properties.objectField.properties.bar2.type: text} |
| 158 | + - match: {test_1.mappings.properties.booleanField.type: boolean} |
| 159 | + - match: {test_1.mappings.properties.longField.type: long} |
| 160 | + - match: {test_1.mappings.properties.doubleField.type: double} |
| 161 | + - match: {test_1.mappings.properties.floatField.type: float} |
| 162 | + - match: {test_1.mappings.properties.integerField.type: integer} |
| 163 | + - match: {test_1.mappings.properties.arrayField.type: keyword} |
| 164 | + - match: {test_1.mappings.properties.author: null} |
| 165 | + - length: {test_1.mappings.properties: 11} |
0 commit comments