Adrien Grand 1adf232bb2 Mappings: Validate dynamic mappings updates on the master node.
This commit changes dynamic mappings updates so that they are synchronous on the
entire cluster and their validity is checked by the master node. There are some
important consequences of this commit:
 - a failing index request on a non-existing type does not implicitely create
   the type anymore
 - dynamic mappings updates cannot create inconsistent mappings on different
   shards
 - indexing requests that introduce new fields might induce latency spikes
   because of the overhead to update the mappings on the master node

Close #8688
2015-04-21 11:08:21 +02:00

130 lines
2.8 KiB
YAML

---
"Create index with mappings":
- do:
indices.create:
index: test_index
body:
mappings:
type_1: {}
- do:
indices.get_mapping:
index: test_index
- match: { test_index.mappings.type_1: {}}
---
"Create index with settings":
- do:
indices.create:
index: test_index
body:
settings:
number_of_replicas: "0"
- do:
indices.get_settings:
index: test_index
- match: { test_index.settings.index.number_of_replicas: "0"}
---
"Create index with warmers":
- do:
indices.create:
index: test_index
body:
warmers:
test_warmer:
source:
query:
match_all: {}
- do:
indices.get_warmer:
index: test_index
- match: {test_index.warmers.test_warmer.source.query.match_all: {}}
---
"Create index with aliases":
- do:
indices.create:
index: test_index
body:
mappings:
type_1:
properties:
field:
type: string
aliases:
test_alias: {}
test_blias:
routing: b
test_clias:
filter:
term:
field : value
- do:
indices.get_alias:
index: test_index
- match: {test_index.aliases.test_alias: {}}
- match: {test_index.aliases.test_blias.search_routing: b}
- match: {test_index.aliases.test_blias.index_routing: b}
- is_false: test_index.aliases.test_blias.filter
- match: {test_index.aliases.test_clias.filter.term.field: value}
- is_false: test_index.aliases.test_clias.index_routing
- is_false: test_index.aliases.test_clias.search_routing
---
"Create index with mappings, settings, warmers and aliases":
- do:
indices.create:
index: test_index
body:
mappings:
type_1: {}
settings:
number_of_replicas: "0"
warmers:
test_warmer:
source:
query:
match_all: {}
aliases:
test_alias: {}
test_blias: {routing: b}
- do:
indices.get_mapping:
index: test_index
- match: { test_index.mappings.type_1: {}}
- do:
indices.get_settings:
index: test_index
- match: { test_index.settings.index.number_of_replicas: "0"}
- do:
indices.get_warmer:
index: test_index
- match: { test_index.warmers.test_warmer.source.query.match_all: {}}
- do:
indices.get_alias:
index: test_index
- match: { test_index.aliases.test_alias: {}}
- match: { test_index.aliases.test_blias.search_routing: b}
- match: { test_index.aliases.test_blias.index_routing: b}