I am creating client, which sent json encoded data to server
Data example:
{
"add": {
"doc": {
"id": "DOC1",
"my_boosted_field": {
"boost": 2.3,
"value": "test"
},
"my_multivalued_field": [ "aaa", "bbb" ]
}
},
"add": {
"commitWithin": 5000,
"overwrite": false,uniqueKey */
"boost": 3.45,
"doc": {
"f1": "v1",
"f1": "v2"
}
},
"commit": {},
"optimize": { "waitFlush":false, "waitSearcher":false },
"delete": { "id":"ID" },
"delete": { "query":"QUERY" }
"delete": { "query":"QUERY", 'commitWithin':'500' }
}
As you can see, there is 2 dict's with 'add' key ant and 3 dict's with 'delete' keys. How its posible?
I am encoding data with:
data = {}
data['delete'] = delete1
data['delete'] = delete2
data['delete'] = delete3
print json.dumps(data)
but it encodes only delete3!
So how to create JSON response with same keys? json.dumps maybe can encode dict with same keys, but how to create them in Python? Python dict key is unique...
Thanks for the help!!!