---
"Test Create and update mapping":
  - do:
      indices.create:
        index: test_index

  - do:
      indices.put_mapping:
        index: test_index
        type: test_type
        body:
          test_type:
            properties:
              text1:
                type:     text
                analyzer: whitespace
              text2:
                type:     text
                analyzer: whitespace

  - do:
      indices.get_mapping:
        index: test_index
  
  - match: {test_index.mappings.test_type.properties.text1.type:     text}
  - match: {test_index.mappings.test_type.properties.text1.analyzer: whitespace}
  - match: {test_index.mappings.test_type.properties.text2.type:     text}
  - match: {test_index.mappings.test_type.properties.text2.analyzer: whitespace}

  - do:
      indices.put_mapping:
        index: test_index
        type: test_type
        body:
          test_type:
            properties:
              text1:
                type:     text
                analyzer: whitespace
                fields:
                  text_raw:
                    type:     keyword


  - do:
      indices.get_mapping:
        index: test_index
  
  - match: {test_index.mappings.test_type.properties.text1.type:     text}
  - match: {test_index.mappings.test_type.properties.text1.fields.text_raw.type: keyword}

---
"Test Create and update mapping":
  - do:
      indices.create:
        index: test_index

  - do:
      indices.put_mapping:
        index: test_index
        type: test_type
        body:
          test_type:
            properties:
              text1:
                type:     text
                analyzer: whitespace
              text2:
                type:     text
                analyzer: whitespace
              subfield.text3:
                type:     text

  - do:
      indices.get_mapping:
        index: test_index
  
  - match: {test_index.mappings.test_type.properties.text1.type:     text}
  - match: {test_index.mappings.test_type.properties.text1.analyzer: whitespace}
  - match: {test_index.mappings.test_type.properties.text2.type:     text}
  - match: {test_index.mappings.test_type.properties.text2.analyzer: whitespace}

  - do:
      indices.put_mapping:
        index: test_index
        type: test_type
        body:
          test_type:
            properties:
              text1:
                type:     text
                analyzer: whitespace
                fields:
                  text_raw:
                    type:     keyword


  - do:
      indices.get_mapping:
        index: test_index
  
  - match: {test_index.mappings.test_type.properties.text1.type:     text}
  - match: {test_index.mappings.test_type.properties.subfield.properties.text3.type:     text}
  - match: {test_index.mappings.test_type.properties.text1.fields.text_raw.type: keyword}

Add rest put mapping test with dot in fieldname
Add rest put mapping test with dot in fieldname
