summaryrefslogtreecommitdiff
path: root/rest-api-spec/test/indices.get_field_mapping/10_basic.yaml
blob: 0b636312f581f6b74ca53be4f5f75c5622244826 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
setup:
  - do:
        indices.create:
          index: test_index
          body:
              mappings:
                test_type:
                  properties:
                    text:
                      type:     string
  - do:
         cluster.health:
           wait_for_status: yellow

---
"Get field mapping with no index and type":

  - do:
      indices.get_field_mapping:
        field: text

  - match: {test_index.mappings.test_type.text.mapping.text.type:     string}

---
"Get field mapping by index only":
  - do:
      indices.get_field_mapping:
        index: test_index
        field: text

  - match: {test_index.mappings.test_type.text.mapping.text.type:     string}

---
"Get field mapping by type & field":

  - do:
      indices.get_field_mapping:
        index: test_index
        type: test_type
        field: text

  - match: {test_index.mappings.test_type.text.mapping.text.type:     string}

---
"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 ]

  - match: {test_index.mappings.test_type.text.mapping.text.type:     string}
  - is_false: test_index.mappings.test_type.text1

---
"Get field mapping with include_defaults":

  - do:
      indices.get_field_mapping:
        index: test_index
        type: test_type
        field: text
        include_defaults: true

  - 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}