Skip to content

Instantly share code, notes, and snippets.

@haldun
Created March 7, 2016 14:15
Show Gist options
  • Save haldun/e02eabe005ba7ff2d3ea to your computer and use it in GitHub Desktop.
Save haldun/e02eabe005ba7ff2d3ea to your computer and use it in GitHub Desktop.
return jsonBuilder()
.startObject()
.startObject(TYPE_NAME)
.startObject("properties")
.startObject("id")
.field("type", "string")
.field("index", "not_analyzed")
.endObject()
.startObject("title")
.field("type", "string")
.endObject()
.startObject("price")
.field("type", "long")
.endObject()
.startObject("originalPrice")
.field("type", "long")
.endObject()
.startObject("units")
.field("type", "nested")
.startObject("properties")
.startObject("size")
.field("type", "string")
.field("index", "not_analyzed")
.endObject()
.startObject("price")
.field("type", "long")
.endObject()
.startObject("originalPrice")
.field("type", "long")
.endObject()
.startObject("currency")
.field("type", "string")
.field("index", "not_analyzed")
.endObject()
.startObject("stock")
.field("type", "long")
.endObject()
.endObject()
.endObject()
.endObject()
.endObject()
.endObject();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment