POST jiankunking_test/_doc/AB8Y7F00L/_update
{"script":{"source":"ctx._source.centerIncludeCustomers.12.add(params.tag)","params":{"tag":"tag5"}}}POST jiankunking_test/_update/AB8Y7F00L
{"script":{"source":"ctx._source.centerIncludeCustomers.12.remove(ctx._source.centerIncludeCustomers.12.indexOf(params.tag))","params":{"tag":"tag5"}}}
批量
POST jiankunking_btbrrs_product_test_random/_doc/232423/_update
{"script":{"source":""" for(int i =0; i < params.saleIncludeCustomers.size(); i++){boolean f =false;for(int j =0; j < ctx._source.saleIncludeCustomers.size(); j++){if(ctx._source.saleIncludeCustomers[j].uid == params.saleIncludeCustomers[i].uid){f=true;break;}}if(!f){ctx._source.saleIncludeCustomers.add(params.saleIncludeCustomers[i]);}}""","lang":"painless","params":{"saleIncludeCustomers":[{"uid":"1.2","code":"1","launchId":"2"},{"uid":"3.4","code":"3","launchId":"4"},{"uid":"5.6","code":"5","launchId":"6"}]}}}POST jiankunking_btbrrs_product_test_random/_doc/34324324/_update
{"script":{"source":""" for(int i =0; i < params.saleIncludeCustomers.size(); i++){boolean f =false;for(int j =0; j < ctx._source.saleIncludeCustomers.size(); j++){if(ctx._source.saleIncludeCustomers[j].uid == params.saleIncludeCustomers[i].uid){f=true;break;}}if(!f){ctx._source.saleIncludeCustomers.remove(params.saleIncludeCustomers[i]);}}""","lang":"painless","params":{"saleIncludeCustomers":[{"uid":"1.2","code":"1","launchId":"2"},{"uid":"3.4","code":"3","launchId":"4"},{"uid":"5.6","code":"5","launchId":"6"}]}}}// 只按照launchId删除
POST jiankunking_test/_doc/345435/_update
{"script":{"source":""" for(int i =0; i < params.saleIncludeCustomers.size(); i++){ctx._source.saleIncludeCustomers.removeIf(item ->item.launchId==params.saleIncludeCustomers[i].launchId);}""","lang":"painless","params":{"saleIncludeCustomers":[{"launchId":"22940336996158744979"}]}}}
every blog every motto: There’s only one corner of the universe you can be sure of improving, and that’s your own self. https://blog.csdn.net/weixin_39190382?spm1010.2135.3001.5343
0. 前言
异常检测库anomalib的使用 1. 前提
1.1 数据组织形式
说明&#…