elasticsearch相关问题

本文介绍了如何在Elasticsearch中进行服务器连接测试及查询语句的使用。重点讲解了桶聚合的概念,提供了详细的聚合查询实例,并探讨了精确查询参数`track_total_hits`的设置及其在返回结果中的作用。

 一、服务器测试是否es连接成功:

curl http://username:password@ip:port

{
  "name" : "node-xxx",
  "cluster_name" : "es",
  "cluster_uuid" : "xxxxxxxx",
  "version" : {
    "number" : "6.8.1",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "xxx",
    "build_date" : "xxxxxx",
    "build_snapshot" : false,
    "lucene_version" : "7.7.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

二、 查询语句:

聚合查询:es中叫桶聚合

转载:ES基本的聚合查询 - 简书

讲的非常详细并举例说明。

精确查询:"track_total_hits":true

转载:ES命令: “track_total_hits“:true_我的博客-优快云博客_track_total_hits

返回结果的含义:

转载:理解Elasticsearch返回结果中命中数total值的具体含义_zhaojianting的博客-优快云博客_es hits total

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值