Elasticsearch 6.3.0 SQL功能使用案例分享
The best elasticsearch highlevel java rest api-----bboss Elasticsearch 6.3.0 官方新增的SQL功能非常不错,本文以实际案例来介绍其使用方法: 通过sql实现检索功能(代码中直接操作sql,从配置中加载sql) 将sql转换为dsl功能 准备工作:集成Elasticsearch Restful API 1.代码中的sql检索 @Test public void testQuery(){ ClientInterface clientUtil = ElasticSearchHelper.getRestClientUtil(); String json = clientUtil.executeHttp("/_xpack/sql?format=txt", "{\"query\": \"SELECT * FROM dbclobdemo\"}", ClientInterface.HTTP_POST ); System.out.println(json); json = clientUtil.executeHttp("/_x...
