190 lines
4.9 KiB
YAML
190 lines
4.9 KiB
YAML
setup:
|
|
- do:
|
|
indices.create:
|
|
index: test_index1
|
|
body:
|
|
settings:
|
|
number_of_replicas: 0
|
|
- do:
|
|
indices.create:
|
|
index: test_index2
|
|
body:
|
|
settings:
|
|
number_of_replicas: 0
|
|
- do:
|
|
indices.create:
|
|
index: foo
|
|
body:
|
|
settings:
|
|
number_of_replicas: 0
|
|
- do:
|
|
cluster.health:
|
|
wait_for_status: green
|
|
|
|
---
|
|
"put one mapping per index":
|
|
- do:
|
|
indices.put_mapping:
|
|
index: test_index1
|
|
type: test_type
|
|
body:
|
|
test_type:
|
|
properties:
|
|
text:
|
|
type: string
|
|
analyzer: whitespace
|
|
- do:
|
|
indices.put_mapping:
|
|
index: test_index2
|
|
type: test_type
|
|
body:
|
|
test_type:
|
|
properties:
|
|
text:
|
|
type: string
|
|
analyzer: whitespace
|
|
|
|
|
|
- do:
|
|
indices.get_mapping: {}
|
|
|
|
- match: {test_index1.mappings.test_type.properties.text.type: string}
|
|
- match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace}
|
|
|
|
- match: {test_index2.mappings.test_type.properties.text.type: string}
|
|
- match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace}
|
|
|
|
- is_false: foo
|
|
|
|
---
|
|
"put mapping in _all index":
|
|
|
|
- do:
|
|
indices.put_mapping:
|
|
index: _all
|
|
type: test_type
|
|
body:
|
|
test_type:
|
|
properties:
|
|
text:
|
|
type: string
|
|
analyzer: whitespace
|
|
|
|
- do:
|
|
indices.get_mapping: {}
|
|
|
|
- match: {test_index1.mappings.test_type.properties.text.type: string}
|
|
- match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace}
|
|
|
|
- match: {test_index2.mappings.test_type.properties.text.type: string}
|
|
- match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace}
|
|
|
|
- match: {foo.mappings.test_type.properties.text.type: string}
|
|
- match: {foo.mappings.test_type.properties.text.analyzer: whitespace}
|
|
|
|
---
|
|
"put mapping in * index":
|
|
- do:
|
|
indices.put_mapping:
|
|
index: "*"
|
|
type: test_type
|
|
body:
|
|
test_type:
|
|
properties:
|
|
text:
|
|
type: string
|
|
analyzer: whitespace
|
|
|
|
- do:
|
|
indices.get_mapping: {}
|
|
|
|
- match: {test_index1.mappings.test_type.properties.text.type: string}
|
|
- match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace}
|
|
|
|
- match: {test_index2.mappings.test_type.properties.text.type: string}
|
|
- match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace}
|
|
|
|
- match: {foo.mappings.test_type.properties.text.type: string}
|
|
- match: {foo.mappings.test_type.properties.text.analyzer: whitespace}
|
|
|
|
---
|
|
"put mapping in prefix* index":
|
|
- do:
|
|
indices.put_mapping:
|
|
index: "test_index*"
|
|
type: test_type
|
|
body:
|
|
test_type:
|
|
properties:
|
|
text:
|
|
type: string
|
|
analyzer: whitespace
|
|
|
|
- do:
|
|
indices.get_mapping: {}
|
|
|
|
- match: {test_index1.mappings.test_type.properties.text.type: string}
|
|
- match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace}
|
|
|
|
- match: {test_index2.mappings.test_type.properties.text.type: string}
|
|
- match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace}
|
|
|
|
- is_false: foo
|
|
|
|
---
|
|
"put mapping in list of indices":
|
|
- do:
|
|
indices.put_mapping:
|
|
index: [test_index1, test_index2]
|
|
type: test_type
|
|
body:
|
|
test_type:
|
|
properties:
|
|
text:
|
|
type: string
|
|
analyzer: whitespace
|
|
|
|
- do:
|
|
indices.get_mapping: {}
|
|
|
|
- match: {test_index1.mappings.test_type.properties.text.type: string}
|
|
- match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace}
|
|
|
|
- match: {test_index2.mappings.test_type.properties.text.type: string}
|
|
- match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace}
|
|
|
|
- is_false: foo
|
|
|
|
---
|
|
"put mapping with blank index":
|
|
- do:
|
|
indices.put_mapping:
|
|
type: test_type
|
|
body:
|
|
test_type:
|
|
properties:
|
|
text:
|
|
type: string
|
|
analyzer: whitespace
|
|
|
|
- do:
|
|
indices.get_mapping: {}
|
|
|
|
- match: {test_index1.mappings.test_type.properties.text.type: string}
|
|
- match: {test_index1.mappings.test_type.properties.text.analyzer: whitespace}
|
|
|
|
- match: {test_index2.mappings.test_type.properties.text.type: string}
|
|
- match: {test_index2.mappings.test_type.properties.text.analyzer: whitespace}
|
|
|
|
- match: {foo.mappings.test_type.properties.text.type: string}
|
|
- match: {foo.mappings.test_type.properties.text.analyzer: whitespace}
|
|
|
|
---
|
|
"put mapping with missing type":
|
|
|
|
|
|
- do:
|
|
catch: param
|
|
indices.put_mapping: {}
|
|
|