|
116 | 116 | {"index": {"_index": "test_index", "_id": "test_id"}}
|
117 | 117 | {"f1": "v1", "f2": 42}
|
118 | 118 | {}
|
| 119 | +
|
| 120 | +--- |
| 121 | +"When setting require_alias flag per request": |
| 122 | + - skip: |
| 123 | + # TODO adjust after backport |
| 124 | + version: " - 7.99.99" |
| 125 | + reason: "require_alias flag was added in version 7.9" |
| 126 | + |
| 127 | + - do: |
| 128 | + indices.create: |
| 129 | + index: backing_index |
| 130 | + body: |
| 131 | + mappings: {} |
| 132 | + aliases: |
| 133 | + test_require_alias: {} |
| 134 | + - do: |
| 135 | + bulk: |
| 136 | + refresh: true |
| 137 | + body: |
| 138 | + - index: |
| 139 | + _index: new_index_not_created |
| 140 | + require_alias: true |
| 141 | + - f: 1 |
| 142 | + - index: |
| 143 | + _index: new_index_created |
| 144 | + - f: 2 |
| 145 | + - index: |
| 146 | + _index: test_require_alias |
| 147 | + require_alias: true |
| 148 | + - f: 3 |
| 149 | + - create: |
| 150 | + _index: test_require_alias |
| 151 | + - f: 4 |
| 152 | + - match: { errors: true } |
| 153 | + - match: { items.0.index.status: 404 } |
| 154 | + - match: { items.0.index.error.type: index_not_found_exception } |
| 155 | + - match: { items.0.index.error.reason: "no such index [new_index_not_created] and [require_alias] request flag is [true] and [new_index_not_created] is not an alias" } |
| 156 | + - match: { items.1.index.result: created } |
| 157 | + - match: { items.2.index.result: created } |
| 158 | + - match: { items.3.create.result: created } |
| 159 | + |
| 160 | + - do: |
| 161 | + catch: missing |
| 162 | + indices.get: |
| 163 | + index: new_index_not_created |
| 164 | +--- |
| 165 | +"When setting require_alias flag": |
| 166 | + - skip: |
| 167 | + # TODO adjust after backport |
| 168 | + version: " - 7.99.99" |
| 169 | + reason: "require_alias flag was added in version 7.9" |
| 170 | + |
| 171 | + - do: |
| 172 | + indices.create: |
| 173 | + index: backing_index |
| 174 | + body: |
| 175 | + mappings: {} |
| 176 | + aliases: |
| 177 | + test_require_alias: {} |
| 178 | + - do: |
| 179 | + bulk: |
| 180 | + refresh: true |
| 181 | + require_alias: true |
| 182 | + body: |
| 183 | + - index: |
| 184 | + _index: new_index_not_created |
| 185 | + - f: 1 |
| 186 | + - index: |
| 187 | + _index: new_index_created |
| 188 | + require_alias: false |
| 189 | + - f: 2 |
| 190 | + - index: |
| 191 | + _index: test_require_alias |
| 192 | + - f: 3 |
| 193 | + - match: { errors: true } |
| 194 | + - match: { items.0.index.status: 404 } |
| 195 | + - match: { items.0.index.error.type: index_not_found_exception } |
| 196 | + - match: { items.0.index.error.reason: "no such index [new_index_not_created] and [require_alias] request flag is [true] and [new_index_not_created] is not an alias" } |
| 197 | + - match: { items.1.index.result: created } |
| 198 | + - match: { items.2.index.result: created } |
| 199 | + |
| 200 | + - do: |
| 201 | + catch: missing |
| 202 | + indices.get: |
| 203 | + index: new_index_not_created |
0 commit comments