2013-10-30 14:19:35 -04:00
|
|
|
---
|
|
|
|
setup:
|
|
|
|
- do:
|
|
|
|
indices.create:
|
|
|
|
index: test_index
|
|
|
|
body:
|
|
|
|
mappings:
|
|
|
|
test_type:
|
|
|
|
properties:
|
|
|
|
text:
|
|
|
|
type: string
|
2014-02-21 14:25:35 -05:00
|
|
|
- do:
|
|
|
|
cluster.health:
|
|
|
|
wait_for_status: yellow
|
2013-10-30 14:19:35 -04:00
|
|
|
|
|
|
|
---
|
|
|
|
"Get field mapping with no index and type":
|
2013-11-05 03:47:02 -05:00
|
|
|
|
2013-10-30 14:19:35 -04:00
|
|
|
- do:
|
|
|
|
indices.get_field_mapping:
|
|
|
|
field: text
|
|
|
|
|
2014-01-14 16:39:28 -05:00
|
|
|
- match: {test_index.mappings.test_type.text.mapping.text.type: string}
|
2013-10-30 14:19:35 -04:00
|
|
|
|
|
|
|
---
|
|
|
|
"Get field mapping by index only":
|
|
|
|
- do:
|
|
|
|
indices.get_field_mapping:
|
|
|
|
index: test_index
|
|
|
|
field: text
|
|
|
|
|
2014-01-14 16:39:28 -05:00
|
|
|
- match: {test_index.mappings.test_type.text.mapping.text.type: string}
|
2013-10-30 14:19:35 -04:00
|
|
|
|
|
|
|
---
|
|
|
|
"Get field mapping by type & field":
|
|
|
|
|
|
|
|
- do:
|
|
|
|
indices.get_field_mapping:
|
|
|
|
index: test_index
|
|
|
|
type: test_type
|
|
|
|
field: text
|
|
|
|
|
2014-01-14 16:39:28 -05:00
|
|
|
- match: {test_index.mappings.test_type.text.mapping.text.type: string}
|
2013-10-30 14:19:35 -04:00
|
|
|
|
|
|
|
---
|
|
|
|
"Get field mapping by type & field, with another field that doesn't exist":
|
|
|
|
|
|
|
|
- do:
|
|
|
|
indices.get_field_mapping:
|
|
|
|
index: test_index
|
|
|
|
type: test_type
|
|
|
|
field: [ text , text1 ]
|
|
|
|
|
2014-01-14 16:39:28 -05:00
|
|
|
- match: {test_index.mappings.test_type.text.mapping.text.type: string}
|
|
|
|
- is_false: test_index.mappings.test_type.text1
|
2013-10-30 14:19:35 -04:00
|
|
|
|
|
|
|
---
|
|
|
|
"Get field mapping with include_defaults":
|
|
|
|
|
|
|
|
- do:
|
|
|
|
indices.get_field_mapping:
|
|
|
|
index: test_index
|
|
|
|
type: test_type
|
|
|
|
field: text
|
|
|
|
include_defaults: true
|
|
|
|
|
2014-01-14 16:39:28 -05:00
|
|
|
- match: {test_index.mappings.test_type.text.mapping.text.type: string}
|
|
|
|
- match: {test_index.mappings.test_type.text.mapping.text.analyzer: default}
|
|
|
|
|
|
|
|
---
|
|
|
|
"Get field mapping should work without index specifying type and field":
|
|
|
|
|
|
|
|
- do:
|
|
|
|
indices.get_field_mapping:
|
|
|
|
type: test_type
|
|
|
|
field: text
|
|
|
|
|
|
|
|
- match: {test_index.mappings.test_type.text.mapping.text.type: string}
|
|
|
|
|