分享

elasticsearch

 孤风卓影 2022-06-21 发布于河南

1.elasticsearch-sql在线安装

$./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/6.2.3.0/elasticsearch-sql-6.2.3.0.zip

2.elasticsearch-sql离线安装

$./elasticsearch-plugin install file:/home/bdp/shangeshishi/elasticsearch-6.5.4/elasticsearch-sql-6.5.4.0.zip 

3.elasticsearch-sql的postMan请求

请求地址
http://10.45.47.66:9200/_sql
请求头
Content-Type:application/json
Authorization:Basic ZWxhc3RpYzpiZHAxMjM=
请求参数
{
  "sql":"desc label_user_info_base_es_20190729"
}
请求效果

低于6.5版本的查询方式略有不同,查询方式为:
http://10.45.47.66:9200/_sql?sql=select * from label_user_info_base_es_20190729

附Base64加密获取代码示例:
String authString = userName + ":" + password;
byte[] authEncBytes = Base64.encodeBase64(authString.getBytes("utf-8"));
String authStringEnc =new String(authEncBytes);

相关pom依赖 <dependency>     <groupId>commons-codec</groupId>     <artifactId>commons-codec</artifactId>     <version>1.14</version> </dependency>

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多