I was trying to understand and to work through some example usages of PyES with elastic search when I found this snippet on Object Type: http://packages.python.org/pyes/guide/reference/mapping/object-type.html
In the example JSON:
{
"tweet" : {
"person" : {
"name" : {
"first_name" : "Shay",
"last_name" : "Banon"
},
"sid" : "12345"
},
"message" : "This is a tweet!"
}
}
"tweet", "person" and "name" are all dicitonaries. Why is it in his example mapping of the object type, he doesn't add "type": "object"
to the "name"
or "tweet"
dictionary, as shown below:
{
"tweet" : {
"properties" : {
"person" : {
"type" : "object",
"properties" : {
"name" : {
"properties" : {
"first_name" : {"type" : "string"},
"last_name" : {"type" : "string"}
}
},
"sid" : {"type" : "string", "index" : "not_analyzed"}
}
}
"message" : {"type" : "string"}
}
}
}