gpt4 book ai didi

elasticsearch - 从具有源模型中的ElasticSearch的模型列表中删除模型

转载 作者:行者123 更新时间:2023-12-03 00:04:08 25 4
gpt4 key购买 nike

以下是我正在使用的代码:

"_source" : {
"name" : "hn name",
"user_id" : 553,
"email_id" : "ns@gmail.com",
"lres_id" : "",
"hres_id" : "hn image",
"followers" : 0,
"following" : 1,
"mentors" : 2,
"mentees" : 2,
"basic_info" : "hn developer",
"birth_date" : 1448451985397,
"charge_price" : 3000,
"org" : "mnc pvt ltd",
"located_in" : "Noidasec51 ",
"position" : "jjunior ava developer",
"requests" : 0,
"exp" : 5,
"video_bio_lres" : "hn test lres url",
"video_bio_hres" : "hn hres url",
"ratings" : [ {
"rating" : 1,
"ratedByUserId" : 777
}, {
"rating" : 1,
"ratedByUserId" : 555
} ],
"avg_rating" : 0.0,
"status" : 0,
"expertises" : [ 3345, 1234, 2345 ],
"blocked_users" : [ ]
}

在下面的代码中,我只想删除ratingratedByUserId 555,但是某些我无法删除。
怎么做?

最佳答案

它对我有用:
curl -XPOST'本地主机:9200 / mentorz / users / 555 / _update'-d
'{“脚本”:“ctx._source.ratings.remove(ratings)”,
“参数”:{
评级‌:{
评分:1‌,
“ratedByUserId”:555‌
}
}
}'

关于elasticsearch - 从具有源模型中的ElasticSearch的模型列表中删除模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46214446/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com