Json Schema => Elasticsearch Mapping Generator
Mapping from Json Sample Data

JSON to YAML Conversion Example

JSON Schema (Example 1)
{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "type": "object",
  "properties": {
    "largeImage": {
      "type": "string",
      "examples": [
        "https://img.bbystatic.com/BestBuy_US/images/products/5712/5712174_sb.jpg"
      ]
    },
    "brandName": {
      "type": "string",
      "examples": [
        "null"
      ]
    },
    "subCategory": {
      "type": "string",
      "examples": [
        "searchresult"
      ]
    },
    "smallImage": {
      "type": "string",
      "examples": [
        "https://img.bbystatic.com/BestBuy_US/images/products/5712/5712174_s.gif"
      ]
    },
    "distance": {
      "type": "null",
      "examples": [
        null
      ]
    },
    "categoryPath": {
      "type": "string",
      "examples": [
        "COMPUTER ACCESSORIES"
      ]
    },
    "mediumImage": {
      "type": "string",
      "examples": [
        "https://img.bbystatic.com/BestBuy_US/images/products/5712/5712174fp.gif"
      ]
    },
    "description": {
      "type": "string",
      "examples": [
        "Ensure smooth gliding and less friction with this Insignia mouse pad. The marble decoration keeps it looking pretty, but it prevents your optical or laser mouse from getting clogged up with dust or dirt to ensure smooth operation. A low-friction surface on this Insignia mouse pad reduces tugging when you're using your mouse."
      ]
    },
    "addToCartLink": {
      "type": "string",
      "examples": [
        "https://api.bestbuy.com/click/-/5712174/cart"
      ]
    },
    "language": {
      "type": "string",
      "examples": [
        "en"
      ]
    },
    "offerType": {
      "type": "string",
      "examples": [
        "Shipping: Ships in 1 business day."
      ]
    },
    "standardShipRate": {
      "type": "integer",
      "examples": [
        0
      ]
    },
    "price": {
      "type": "number",
      "examples": [
        4.99
      ]
    },
    "vendor": {
      "type": "string",
      "examples": [
        "Best Buy"
      ]
    },
    "msrp": {
      "type": "number",
      "examples": [
        4.99
      ]
    },
    "name": {
      "type": "string",
      "examples": [
        "Insignia™ - Mouse Pad - Marble"
      ]
    },
    "productLink": {
      "type": "string",
      "examples": [
        "https://api.bestbuy.com/click/-/5712174/pdp"
      ]
    },
    "id": {
      "type": "string",
      "examples": [
        "null"
      ]
    },
    "stock": {
      "type": "string",
      "examples": [
        "Store Pickup:"
      ]
    },
    "category": {
      "type": "string",
      "examples": [
        "product"
      ]
    }
  }
}
Converted Elaticsearch 6.x Mapping (Example 1)
{
  "mappings": {
    "_doc": {
      "properties": {
        "largeImage": {
          "analyzer": "english",
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "brandName": {
          "analyzer": "english",
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "subCategory": {
          "analyzer": "english",
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "smallImage": {
          "analyzer": "english",
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "distance": {
          "type": "null"
        },
        "categoryPath": {
          "analyzer": "english",
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "mediumImage": {
          "analyzer": "english",
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "description": {
          "analyzer": "english",
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "addToCartLink": {
          "analyzer": "english",
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "language": {
          "analyzer": "english",
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "offerType": {
          "analyzer": "english",
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "standardShipRate": {
          "type": "long"
        },
        "price": {
          "type": "float"
        },
        "vendor": {
          "analyzer": "english",
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "msrp": {
          "type": "float"
        },
        "name": {
          "analyzer": "english",
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "productLink": {
          "analyzer": "english",
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "id": {
          "index": "not_analyzed",
          "type": "keyword",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "stock": {
          "analyzer": "english",
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "category": {
          "analyzer": "english",
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        }
      }
    }
  }
}
JSON Schema (Example 2)
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "web-app": {
      "type": "object",
      "properties": {
        "servlet-mapping": {
          "type": "object",
          "properties": {
            "cofaxAdmin": {
              "type": "string"
            },
            "cofaxCDS": {
              "type": "string"
            },
            "cofaxEmail": {
              "type": "string"
            },
            "fileServlet": {
              "type": "string"
            },
            "cofaxTools": {
              "type": "string"
            }
          }
        },
        "taglib": {
          "type": "object",
          "properties": {
            "taglib-location": {
              "type": "string"
            },
            "taglib-uri": {
              "type": "string"
            }
          }
        },
        "servlet": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "init-param": {
                "type": "object",
                "properties": {
                  "cachePackageTagsTrack": {
                    "type": "integer"
                  },
                  "configGlossary:staticPath": {
                    "type": "string"
                  },
                  "configGlossary:installationAt": {
                    "type": "string"
                  },
                  "cacheTemplatesTrack": {
                    "type": "integer"
                  },
                  "configGlossary:poweredBy": {
                    "type": "string"
                  },
                  "searchEngineFileTemplate": {
                    "type": "string"
                  },
                  "templateProcessorClass": {
                    "type": "string"
                  },
                  "searchEngineListTemplate": {
                    "type": "string"
                  },
                  "useDataStore": {
                    "type": "boolean"
                  },
                  "betaServer": {
                    "type": "boolean"
                  },
                  "templateLoaderClass": {
                    "type": "string"
                  },
                  "searchEngineRobotsDb": {
                    "type": "string"
                  },
                  "logLocation": {
                    "type": "string"
                  },
                  "mailHost": {
                    "type": "string"
                  },
                  "cachePackageTagsRefresh": {
                    "type": "integer"
                  },
                  "dataStoreLogLevel": {
                    "type": "string"
                  },
                  "fileTransferFolder": {
                    "type": "string"
                  },
                  "dataStoreTestQuery": {
                    "type": "string"
                  },
                  "lookInContext": {
                    "type": "integer"
                  },
                  "dataStoreMaxConns": {
                    "type": "integer"
                  },
                  "dataStoreName": {
                    "type": "string"
                  },
                  "templateOverridePath": {
                    "type": "string"
                  },
                  "dataStoreLogFile": {
                    "type": "string"
                  },
                  "dataStoreInitConns": {
                    "type": "integer"
                  },
                  "dataLog": {
                    "type": "integer"
                  },
                  "redirectionClass": {
                    "type": "string"
                  },
                  "jspFileTemplate": {
                    "type": "string"
                  },
                  "cacheTemplatesRefresh": {
                    "type": "integer"
                  },
                  "dataStorePassword": {
                    "type": "string"
                  },
                  "dataStoreClass": {
                    "type": "string"
                  },
                  "log": {
                    "type": "integer"
                  },
                  "defaultFileTemplate": {
                    "type": "string"
                  },
                  "dataLogLocation": {
                    "type": "string"
                  },
                  "configGlossary:adminEmail": {
                    "type": "string",
                    "format": "email"
                  },
                  "cachePagesStore": {
                    "type": "integer"
                  },
                  "configGlossary:poweredByIcon": {
                    "type": "string"
                  },
                  "cachePagesTrack": {
                    "type": "integer"
                  },
                  "cachePagesDirtyRead": {
                    "type": "integer"
                  },
                  "dataLogMaxSize": {
                    "type": "string"
                  },
                  "cachePackageTagsStore": {
                    "type": "integer"
                  },
                  "mailHostOverride": {
                    "type": "string"
                  },
                  "dataStoreConnUsageLimit": {
                    "type": "integer"
                  },
                  "logMaxSize": {
                    "type": "string"
                  },
                  "useJSP": {
                    "type": "boolean"
                  },
                  "dataStoreUrl": {
                    "type": "string"
                  },
                  "templatePath": {
                    "type": "string"
                  },
                  "cacheTemplatesStore": {
                    "type": "integer"
                  },
                  "removeTemplateCache": {
                    "type": "string"
                  },
                  "jspListTemplate": {
                    "type": "string"
                  },
                  "removePageCache": {
                    "type": "string"
                  },
                  "adminGroupID": {
                    "type": "integer"
                  },
                  "maxUrlLength": {
                    "type": "integer"
                  },
                  "cachePagesRefresh": {
                    "type": "integer"
                  },
                  "dataStoreDriver": {
                    "type": "string"
                  },
                  "dataStoreUser": {
                    "type": "string"
                  },
                  "defaultListTemplate": {
                    "type": "string"
                  }
                }
              },
              "servlet-name": {
                "type": "string"
              },
              "servlet-class": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
Converted Elaticsearch 5.x Mapping (Example 2)
{
  "properties": {
    "web-app": {
      "type": "nested",
      "properties": {
        "servlet-mapping": {
          "type": "nested",
          "properties": {
            "cofaxAdmin": {
              "ignore_above": 256,
              "type": "string",
              "fields": {
                "english": {
                  "type": "string",
                  "analyzer": "english"
                },
                "raw": {
                  "type": "string"
                }
              }
            },
            "cofaxCDS": {
              "ignore_above": 256,
              "type": "string",
              "fields": {
                "english": {
                  "type": "string",
                  "analyzer": "english"
                },
                "raw": {
                  "type": "string"
                }
              }
            },
            "cofaxEmail": {
              "ignore_above": 256,
              "type": "string",
              "fields": {
                "english": {
                  "type": "string",
                  "analyzer": "english"
                },
                "raw": {
                  "type": "string"
                }
              }
            },
            "fileServlet": {
              "ignore_above": 256,
              "type": "string",
              "fields": {
                "english": {
                  "type": "string",
                  "analyzer": "english"
                },
                "raw": {
                  "type": "string"
                }
              }
            },
            "cofaxTools": {
              "ignore_above": 256,
              "type": "string",
              "fields": {
                "english": {
                  "type": "string",
                  "analyzer": "english"
                },
                "raw": {
                  "type": "string"
                }
              }
            }
          }
        },
        "taglib": {
          "type": "nested",
          "properties": {
            "taglib-location": {
              "ignore_above": 256,
              "type": "string",
              "fields": {
                "english": {
                  "type": "string",
                  "analyzer": "english"
                },
                "raw": {
                  "type": "string"
                }
              }
            },
            "taglib-uri": {
              "ignore_above": 256,
              "type": "string",
              "fields": {
                "english": {
                  "type": "string",
                  "analyzer": "english"
                },
                "raw": {
                  "type": "string"
                }
              }
            }
          }
        },
        "servlet": {
          "type": "nested",
          "properties": {
            "init-param": {
              "type": "nested",
              "properties": {
                "cachePackageTagsTrack": {
                  "type": "long"
                },
                "configGlossary:staticPath": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "configGlossary:installationAt": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "cacheTemplatesTrack": {
                  "type": "long"
                },
                "configGlossary:poweredBy": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "searchEngineFileTemplate": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "templateProcessorClass": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "searchEngineListTemplate": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "useDataStore": {
                  "type": "boolean"
                },
                "betaServer": {
                  "type": "boolean"
                },
                "templateLoaderClass": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "searchEngineRobotsDb": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "logLocation": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "mailHost": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "cachePackageTagsRefresh": {
                  "type": "long"
                },
                "dataStoreLogLevel": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "fileTransferFolder": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "dataStoreTestQuery": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "lookInContext": {
                  "type": "long"
                },
                "dataStoreMaxConns": {
                  "type": "long"
                },
                "dataStoreName": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "templateOverridePath": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "dataStoreLogFile": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "dataStoreInitConns": {
                  "type": "long"
                },
                "dataLog": {
                  "type": "long"
                },
                "redirectionClass": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "jspFileTemplate": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "cacheTemplatesRefresh": {
                  "type": "long"
                },
                "dataStorePassword": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "dataStoreClass": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "log": {
                  "type": "long"
                },
                "defaultFileTemplate": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "dataLogLocation": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "configGlossary:adminEmail": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "cachePagesStore": {
                  "type": "long"
                },
                "configGlossary:poweredByIcon": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "cachePagesTrack": {
                  "type": "long"
                },
                "cachePagesDirtyRead": {
                  "type": "long"
                },
                "dataLogMaxSize": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "cachePackageTagsStore": {
                  "type": "long"
                },
                "mailHostOverride": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "dataStoreConnUsageLimit": {
                  "type": "long"
                },
                "logMaxSize": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "useJSP": {
                  "type": "boolean"
                },
                "dataStoreUrl": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "templatePath": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "cacheTemplatesStore": {
                  "type": "long"
                },
                "removeTemplateCache": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "jspListTemplate": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "removePageCache": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "adminGroupID": {
                  "type": "long"
                },
                "maxUrlLength": {
                  "type": "long"
                },
                "cachePagesRefresh": {
                  "type": "long"
                },
                "dataStoreDriver": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "dataStoreUser": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                },
                "defaultListTemplate": {
                  "ignore_above": 256,
                  "type": "string",
                  "fields": {
                    "english": {
                      "type": "string",
                      "analyzer": "english"
                    },
                    "raw": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "servlet-name": {
              "ignore_above": 256,
              "type": "string",
              "fields": {
                "english": {
                  "type": "string",
                  "analyzer": "english"
                },
                "raw": {
                  "type": "string"
                }
              }
            },
            "servlet-class": {
              "ignore_above": 256,
              "type": "string",
              "fields": {
                "english": {
                  "type": "string",
                  "analyzer": "english"
                },
                "raw": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}

Copyright © Karigar's Input/Output Tools 2020.