select * from A
where A.ID = "1"
and (A.Name = '张三' or A.Name like '%张三%')
主要业务就是精确查询(term)不到张三的时候,就用模糊查询
DSL如下
java api
BoolQueryBuilder boolquery =QueryBuilders.boolQuery();
//查询条件
QueryBuilder qId= QueryBuilders.termQuery("Id","1");
boolquery.must(qId);
....下面的bool should该如果再次嵌到must里面去呢
1 个回复
rochy - rochy_he
赞同来自: GLC