2013-12-11 09:00:33 -05:00
|
|
|
---
|
|
|
|
setup:
|
|
|
|
- do:
|
|
|
|
indices.create:
|
|
|
|
index: test_index
|
|
|
|
body:
|
|
|
|
mappings:
|
|
|
|
test_type:
|
|
|
|
properties:
|
|
|
|
t1:
|
|
|
|
type: string
|
|
|
|
t2:
|
|
|
|
type: string
|
|
|
|
obj:
|
|
|
|
path: just_name
|
|
|
|
properties:
|
|
|
|
t1:
|
|
|
|
type: string
|
|
|
|
i_t1:
|
|
|
|
type: string
|
|
|
|
index_name: t1
|
|
|
|
i_t3:
|
|
|
|
type: string
|
|
|
|
index_name: t3
|
|
|
|
|
2014-01-14 16:39:28 -05:00
|
|
|
- do:
|
|
|
|
indices.create:
|
|
|
|
index: test_index_2
|
|
|
|
body:
|
|
|
|
mappings:
|
|
|
|
test_type_2:
|
|
|
|
properties:
|
|
|
|
t1:
|
|
|
|
type: string
|
|
|
|
t2:
|
|
|
|
type: string
|
|
|
|
obj:
|
|
|
|
path: just_name
|
|
|
|
properties:
|
|
|
|
t1:
|
|
|
|
type: string
|
|
|
|
i_t1:
|
|
|
|
type: string
|
|
|
|
index_name: t1
|
|
|
|
i_t3:
|
|
|
|
type: string
|
|
|
|
index_name: t3
|
|
|
|
|
2014-01-15 11:03:30 -05:00
|
|
|
- do:
|
|
|
|
cluster.health:
|
|
|
|
wait_for_status: yellow
|
|
|
|
|
2013-12-11 09:00:33 -05:00
|
|
|
---
|
|
|
|
"Get field mapping with * for fields":
|
|
|
|
|
|
|
|
- do:
|
|
|
|
indices.get_field_mapping:
|
|
|
|
field: "*"
|
|
|
|
|
2014-01-14 16:39:28 -05:00
|
|
|
- match: {test_index.mappings.test_type.t1.full_name: t1 }
|
|
|
|
- match: {test_index.mappings.test_type.t2.full_name: t2 }
|
|
|
|
- match: {test_index.mappings.test_type.obj\.t1.full_name: obj.t1 }
|
|
|
|
- match: {test_index.mappings.test_type.obj\.i_t1.full_name: obj.i_t1 }
|
|
|
|
- match: {test_index.mappings.test_type.obj\.i_t3.full_name: obj.i_t3 }
|
2013-12-11 09:00:33 -05:00
|
|
|
|
|
|
|
---
|
|
|
|
"Get field mapping with t* for fields":
|
|
|
|
|
|
|
|
- do:
|
|
|
|
indices.get_field_mapping:
|
2014-01-14 16:39:28 -05:00
|
|
|
index: test_index
|
2013-12-11 09:00:33 -05:00
|
|
|
field: "t*"
|
|
|
|
|
|
|
|
# i_t1 matches the pattern using it's index name, but t1 already means a full name
|
|
|
|
# of a field and thus takes precedence.
|
2014-01-14 16:39:28 -05:00
|
|
|
- match: {test_index.mappings.test_type.t1.full_name: t1 }
|
|
|
|
- match: {test_index.mappings.test_type.t2.full_name: t2 }
|
|
|
|
- match: {test_index.mappings.test_type.t3.full_name: obj.i_t3 }
|
|
|
|
- length: {test_index.mappings.test_type: 3}
|
2013-12-11 09:00:33 -05:00
|
|
|
|
|
|
|
---
|
|
|
|
"Get field mapping with *t1 for fields":
|
|
|
|
|
|
|
|
- do:
|
|
|
|
indices.get_field_mapping:
|
2014-01-14 16:39:28 -05:00
|
|
|
index: test_index
|
2013-12-11 09:00:33 -05:00
|
|
|
field: "*t1"
|
2014-01-14 16:39:28 -05:00
|
|
|
- match: {test_index.mappings.test_type.t1.full_name: t1 }
|
|
|
|
- match: {test_index.mappings.test_type.obj\.t1.full_name: obj.t1 }
|
|
|
|
- match: {test_index.mappings.test_type.obj\.i_t1.full_name: obj.i_t1 }
|
|
|
|
- length: {test_index.mappings.test_type: 3}
|
2013-12-11 09:00:33 -05:00
|
|
|
|
|
|
|
---
|
|
|
|
"Get field mapping with wildcarded relative names":
|
|
|
|
|
|
|
|
- do:
|
|
|
|
indices.get_field_mapping:
|
2014-01-14 16:39:28 -05:00
|
|
|
index: test_index
|
|
|
|
field: "i_*"
|
|
|
|
- match: {test_index.mappings.test_type.i_t1.full_name: obj.i_t1 }
|
|
|
|
- match: {test_index.mappings.test_type.i_t3.full_name: obj.i_t3 }
|
|
|
|
- length: {test_index.mappings.test_type: 2}
|
|
|
|
|
|
|
|
---
|
|
|
|
"Get field mapping should work using '_all' for indices and types":
|
|
|
|
|
|
|
|
- do:
|
|
|
|
indices.get_field_mapping:
|
|
|
|
index: _all
|
|
|
|
type: _all
|
|
|
|
field: "i_*"
|
|
|
|
- match: {test_index.mappings.test_type.i_t1.full_name: obj.i_t1 }
|
|
|
|
- match: {test_index.mappings.test_type.i_t3.full_name: obj.i_t3 }
|
|
|
|
- length: {test_index.mappings.test_type: 2}
|
|
|
|
- match: {test_index_2.mappings.test_type_2.i_t1.full_name: obj.i_t1 }
|
|
|
|
- match: {test_index_2.mappings.test_type_2.i_t3.full_name: obj.i_t3 }
|
|
|
|
- length: {test_index_2.mappings.test_type_2: 2}
|
|
|
|
|
|
|
|
---
|
|
|
|
"Get field mapping should work using '*' for indices and types":
|
|
|
|
|
|
|
|
- do:
|
|
|
|
indices.get_field_mapping:
|
|
|
|
index: '*'
|
|
|
|
type: '*'
|
|
|
|
field: "i_*"
|
|
|
|
- match: {test_index.mappings.test_type.i_t1.full_name: obj.i_t1 }
|
|
|
|
- match: {test_index.mappings.test_type.i_t3.full_name: obj.i_t3 }
|
|
|
|
- length: {test_index.mappings.test_type: 2}
|
|
|
|
- match: {test_index_2.mappings.test_type_2.i_t1.full_name: obj.i_t1 }
|
|
|
|
- match: {test_index_2.mappings.test_type_2.i_t3.full_name: obj.i_t3 }
|
|
|
|
- length: {test_index_2.mappings.test_type_2: 2}
|
|
|
|
|
|
|
|
---
|
|
|
|
"Get field mapping should work using comma_separated values for indices and types":
|
|
|
|
|
|
|
|
- do:
|
|
|
|
indices.get_field_mapping:
|
|
|
|
index: 'test_index,test_index_2'
|
|
|
|
type: 'test_type,test_type_2'
|
2013-12-11 09:00:33 -05:00
|
|
|
field: "i_*"
|
2014-01-14 16:39:28 -05:00
|
|
|
- match: {test_index.mappings.test_type.i_t1.full_name: obj.i_t1 }
|
|
|
|
- match: {test_index.mappings.test_type.i_t3.full_name: obj.i_t3 }
|
|
|
|
- length: {test_index.mappings.test_type: 2}
|
|
|
|
- match: {test_index_2.mappings.test_type_2.i_t1.full_name: obj.i_t1 }
|
|
|
|
- match: {test_index_2.mappings.test_type_2.i_t3.full_name: obj.i_t3 }
|
|
|
|
- length: {test_index_2.mappings.test_type_2: 2}
|
|
|
|
|