Skip to content

Instantly share code, notes, and snippets.

Created July 31, 2014 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/febab9c09bdf9ea9849c to your computer and use it in GitHub Desktop.
Save anonymous/febab9c09bdf9ea9849c to your computer and use it in GitHub Desktop.
Mapping and data for nested type
{
"person" : {
"properties" : {
"forename" : {"type" : "string" },
"surname" : {"type" : "string" },
"dob" : {"type" : "date" ,"format" : "YYYY-MM-dd"},
"attachments" : {
"type" : "nested",
"include_in_all" : false
}
}
}
}
{
"forename" : "Charlotte",
"surname" : "Bronte",
"dob" : "1816-04-21",
"attachments" : [
{
"title" : "Jane Eyre",
"url" : "http://www.gutenberg.org/files/1260/1260-h/1260-h.htm",
"contents" : "There was no possibility of taking a walk that day. We had been wandering, indeed, in the leafless shrubbery an hour in the morning; but since dinner (Mrs. Reed, when there was no company, dined early) the cold winter wind had brought with it clouds so sombre, and a rain so penetrating, that further out-door exercise was now out of the question."
},
{
"title" : "Villette",
"url" : "http://www.gutenberg.org/cache/epub/9182/pg9182.txt",
"contents" : "My godmother lived in a handsome house in the clean and ancient town of Bretton. Her husband's family had been residents there for generations, and bore, indeed, the name of their birthplace--Bretton of Bretton:whether by coincidence, or because some remote ancestor had been a personage of sufficient importance to leave his name to his neighbourhood, I know not."
}
]
}
{
"forename" : "Jane",
"surname" : "Austen",
"dob" : "1775-12-16",
"attachments" : [
{
"title" : "Emma",
"url" : "http://www.gutenberg.org/cache/epub/158/pg158.txt",
"contents" : "Emma Woodhouse, handsome, clever, and rich, with a comfortable home and happy disposition, seemed to unite some of the best blessings of existence; and had lived nearly twenty-one years in the world with very little to distress or vex her."
},
{
"title" : "Pride and Prejudice",
"url" : "http://www.gutenberg.org/cache/epub/1342/pg1342.txt",
"contents" : "It is a truth universally acknowledged, that a single man in possession of a good fortune, must be in want of a wife."
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment