代码语言:javascript复制
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);
}