ES 模糊查询 实现像Mysql like %%那样的模糊查询

        BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
        WildcardQueryBuilder wildcardQueryBuilder = QueryBuilders.wildcardQuery(keyName+".keyword", "*" +value + "*");
        boolQueryBuilder.must(wildcardQueryBuilder);

其中keyName为要匹配的字段名,value为要匹配的字段值

你可能感兴趣的:(elasticsearch,mysql,java)