首页 > 其他分享 >在 ES 里我想把两个字段的值是一样的查出来。

在 ES 里我想把两个字段的值是一样的查出来。

时间:2023-07-15 22:56:30浏览次数:28  
标签:Script idOrCode getAreaEqualSecondAreaId area 字段 new 查出来 id ES

 

 

if (Objects.nonNull(param.getAreaEqualSecondAreaId()) && param.getAreaEqualSecondAreaId()) {
Map<String, Object> params = new HashMap<>();
String idOrCode = "doc['area_id'].value - doc['second_area_id'].value == 0";
Script script = new Script(ScriptType.INLINE, "painless", idOrCode, params);
ScriptQueryBuilder scriptQueryBuilder = new ScriptQueryBuilder(script);
builder.must(scriptQueryBuilder);
}

  

标签:Script,idOrCode,getAreaEqualSecondAreaId,area,字段,new,查出来,id,ES
From: https://www.cnblogs.com/lingyejun/p/17557154.html

相关文章

  • LeetCode 658. Find K Closest Elements 二分+双指针
    Givenasortedintegerarrayarr,twointegerskandx,returnthekclosestintegerstoxinthearray.Theresultshouldalsobesortedinascendingorder.Anintegeraisclosertoxthananintegerbif:|a-x|<|b-x|,or|a-x|==|b-x|an......
  • freee Programming Contest 2023(AtCoder Beginner Contest 310)题解
    点我看题A-OrderSomethingElse直接比较\(P\)和\(Q+min(D_i)\),输出较小值即可。点击查看代码#include<bits/stdc++.h>#definerep(i,n)for(inti=0;i<n;++i)#definerepn(i,n)for(inti=1;i<=n;++i)#defineLLlonglong#definefifirst#definesesecond#defi......
  • AtCoder Beginner Contest 310
    目录题目传送门:abc310比赛摘记:B题没读懂题意。。。如此简单题卡了好久继续加油哈......
  • flex and bison usage in PostgreSQL
    flex/bisonusageinpgsqlInregularbisonusage,wecallyyparse()togetanAST.So,IsearchedforyyparseinPostgreSQLsourcecode,whicheventuallyledmetothebase_yyparse()function.Whatisthat?Ingram.y:%name-prefix="base_yy"%par......
  • kubernetes之 RBAC
    第十一部分RBACrestful操作对象:许可授权都作用于角色,用户是什么角色,就拥有什么操作权限授权插件:Node、ABAC、RBAC、WebhookRBAC:Role-basedAC角色:Role许可:permission关联图示客户端访问示意图:role:operations:许可object:rolebinging:useraccountorserviceacco......
  • (转)我所理解的Entitas——IInitializeSystem(六)
    从这章这开始我们以一个小案例分章介绍Entitas为我们提供的五种类型的System。案例的主要功能比较简单,大致的流程如下:在游戏启动时在屏幕上创建一个站立的小熊,点击键盘上的左右按键时将小熊切换成一个对应方向的Sprite,朝对应方向移动并实时打印位置信息。松开左右按键时切换回站......
  • Codeforces Round #881 (Div. 3) A-F
    比赛链接A代码#include<bits/stdc++.h>usingnamespacestd;usingll=longlong;inta[57];boolsolve(){intn;cin>>n;for(inti=1;i<=n;i++)cin>>a[i];sort(a+1,a+n+1);intsum=0;for(inti......
  • vite-plugin-vue-images——Vite自动导入图片
    vite-plugin-vue-images——Vite自动导入图片在Vue2时我们经常会这样引用图片:<img:src='require("地址")'/>但在Vite中不支持require了,引用图片变成了下面这样:<template><img:src='imgUrl'/></template><scriptsetup>importimgUrl......
  • typescript 中严格字面量类型检查的理解
    个人关于TS中Strictobjectliteralassignmentchecking的理解StrictobjectliteralassignmentcheckingStrictobjectliteralassignmentcheckingbyahejlsberg·PullRequest#3823·microsoft/TypeScript案例interfaceIStudent{name:stringid:strin......
  • mysql Specified key was too long; max key length is 767 bytes
    MySQL指定的索引键太长;最大键长度为767字节在使用MySQL数据库时,我们可能会遇到一个常见的错误:“Specifiedkeywastoolong;maxkeylengthis767bytes”。这个错误通常在创建索引时出现,意味着指定的索引键的长度超过了MySQL允许的最大长度。什么是索引?索引是数据库中用于加......