Update where condition in elasticsearch


(Amit Kumar Patra) #1

Hi,
We have thousand of records like below json.
{
"_index": "commusat.mms_cri",
"_type": "doc",
"_id": "pcolWGYBbjbfpczOv192",
"_version": 1,
"_score": null,
"_source": {
"id": "236e66510e049b70",
"case_name": null,
"calling_lat": 57.26625,
"calling_tmsi": null,
"interception_mode": "L_ONLY",
"sms_content": null,
"terminal_type": null,
"endreason": null,
"cld_alias": null,
"called_imei": null,
"interception_system": "ISAT",
"calling_long": -16.57479,
"country_contacted": null,
"starttime": "2016-04-24T10:43:56.000Z",
"calling_imei": "35303204178532",
"duration": null,
"calling_spot": null,
"noi_flag": null,
"calling_imsi": "901112116285962",
"establishment_cause": "LOCATIONUPDATE",
"direction": "O",
"called_spot": null,
"country_code": null,
"satelite_name": "PKSAT002",
"type": "rcaproperty",
"called_tmsi": null,
"lmby": 0,
"@timestamp": "2018-10-09T09:26:00.690Z",
"lmdt": null,
"callingparty": null,
"cli_alias": null,
"t2thop": null,
"calledparty": null,
"called_long": null,
"called_lat": null,
"lmdt1": "2017-10-04T10:42:30.000Z",
"called_imsi": null,
"calltype": "LOC",
"t2tid": null,
"@version": "1"
},
"fields": {
"@timestamp": [
"2018-10-09T09:26:00.690Z"
],
"lmdt1": [
"2017-10-04T10:42:30.000Z"
],
"starttime": [
"2016-04-24T10:43:56.000Z"
]
},
"sort": [
1461494636000
]
}

We want to update the records in a where condition. We want to append a Field trans_remarks on update that will store as array key value pair.

Like for id 236e66510e049b70 , we want to append

"trans_remarks": [ { "user_id": "50", "remarks": "keep on track" } , { "user_id": "10", "remarks": "India on track" } ]

What will the update query for that.

Thanks,


(Amit Kumar Patra) #2

Hi @Christian_Dahlqvist,

can please help me out.

Thanks,


(David Pilato) #3

Read this and specifically the "Also be patient" part.

It's fine to answer on your own thread after 2 or 3 days (not including weekends) if you don't have an answer.

Do not ping people who are not yet in the thread


(Amit Kumar Patra) #4

Hi

can anyone please help me out.

Thanks,


(Amit Kumar Patra) #5

Hi

can anyone please help me out.

Thanks,


(system) #6

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.