elasticsearch _search结果解析
kibana中输入:GET /_search
会返回一下结果:
- {
- "took": 9, # took:整个搜索请求花费多少毫秒
- "timed_out": false,
- "_shards": { # shards:shards fail的条件,primary和replica全部挂掉,不影响其他shard。
- # 默认情况,一个搜索请求,会发送到一个index的所有primary shard上;
- # 当然,一个primary shard可能会有多个replica shard,所以请求也可能到其中某个replica shard 上。
- "total": 20,
- "successful": 20,
- "skipped": 0,
- "failed": 0
- },
- "hits": {
- "total": 6, # 本次搜索,返回多少条结果
- "max_score": 1, # 本次搜索结果中最大的相关分数,
- # 每一条document对于search的相关度,越相关,source分数越大,排位越靠前
- "hits": [ # 默认查询前十条数据,查询完整的数据,以_source降序排序
- {
- "_index": "ecommerce",
- "_type": "product",
- "_id": "2",
- "_score": 1,
- "_source": {
- "name": "jiajieshi yagao",
- "desc": "youxiao fangzhu",
- "price": 25,
- "producer": "jiajieshi producer",
- "tags": [
- "fangzhu"
- ]
- }
- },
- {
- "_index": "test_index",
- "_type": "test_type",
- "_id": "2",
- "_score": 1,
- "_source": {
- "test_field": "test client 1"
- }
- },
- {
- "_index": "ecommerce",
- "_type": "product",
- "_id": "1",
- "_score": 1,
- "_source": {
- "name": "gaolujie yagao",
- "desc": "gaoxiao meibai",
- "price": 30,
- "producer": "gaolujie producer",
- "tags": [
- "meibai",
- "fangzhu"
- ]
- }
- },
- {
- "_index": "my_index",
- "_type": "my_type",
- "_id": "1",
- "_score": 1,
- "_source": {
- "test_field": "test data 1"
- }
- },
- {
- "_index": "test_index",
- "_type": "test_type",
- "_id": "1",
- "_score": 1,
- "_source": {
- "test_field": "test client 1"
- }
- },
- {
- "_index": "ecommerce",
- "_type": "product",
- "_id": "3",
- "_score": 1,
- "_source": {
- "name": "zhonghua yagao",
- "desc": "caoben zhiwu",
- "price": 40,
- "producer": "zhonghua producer",
- "tags": [
- "qingxin"
- ]
- }
- }
- ]
- }
- }
elasticsearch _search结果解析的更多相关文章
- 渣渣菜鸡的 ElasticSearch 源码解析 —— 启动流程(下)
关注我 转载请务必注明原创地址为:http://www.54tianzhisheng.cn/2018/08/12/es-code03/ 前提 上篇文章写完了 ES 流程启动的一部分,main 方法都入 ...
- 渣渣菜鸡的 ElasticSearch 源码解析 —— 启动流程(上)
关注我 转载请务必注明原创地址为:http://www.54tianzhisheng.cn/2018/08/11/es-code02/ 前提 上篇文章写了 ElasticSearch 源码解析 -- ...
- ElasticSearch源码解析(五):排序(评分公式)
ElasticSearch源码解析(五):排序(评分公式) 转载自:http://blog.csdn.net/molong1208/article/details/50623948 一.目的 一个 ...
- Splunk和ElasticSearch深度对比解析(转)
转载自:http://www.sohu.com/a/154105465_354963 随着Splunk越来越被大家熟知和认可,现在市面上也不断涌各种同类产品,作为大数据搜索界的翘楚Splunk和Ela ...
- ElasticSearch的概念解析
ElasticSearch是面向文档的,它不仅仅可以存储整个对象或则文档(document),还会索引(index)每个文档的内容使它可以被快速的检索.ElasticSearch和关系型数据库的对比如 ...
- 渣渣菜鸡的 ElasticSearch 源码解析 —— 环境搭建
关注我 转载请务必注明原创地址为:http://www.54tianzhisheng.cn/2018/08/25/es-code01/ 软件环境 1.Intellij Idea:2018.2版本 2. ...
- Elasticsearch 监控指标解析
1.集群监控 集群监控主要包括两个方面的内容,分别是集群健康情况和集群的运行状态. 集群健康状态可以通过以下api获取: http://ip:9200/_cluster/health?pretty 关 ...
- Elasticsearch源码解析:环境搭建
在之前学习Redis的过程中,我就是一边通过文档/视频学习,一边阅读源码.我发现两种方法可以相辅相成,互相补充.阅读文档可以帮助我们快速了解某个功能,阅读源码有助于我们更深入的理解这一功能的实现及思想 ...
- 使用Java客户端操作elasticsearch
Java REST客户端有两种风格: Java低级别REST客户端(Java Low Level REST Client,以后都简称低级客户端算了,难得码字):Elasticsearch的官方low- ...
随机推荐
- EXCEL导入数据到SQL SERVER 2008
项目中需要导入excel到SQL SERVER数据库 总是报截断, 本质问题是,SQL SERVER导入程序是根据EXCEL的第一行记录 (非标题行)来决定数据长度的 碰到这个问题,可以伪造第一行,然 ...
- phpstorm快捷键使用
- <你们都是魔鬼吗>第二次团队作业:团队项目选题
第二次团队作业:团队项目选题 项目 内容 这个作业属于哪个课程 任课教师博客主页链接 这个作业的要求在哪里 作业链接地址 团队名称 你们都是魔鬼吗 作业学习目标 任务1: 团队初选项目可行性自评,使用 ...
- GBDT算法梳理
1.GBDT(Gradient Boosting Decision Tree)思想 Boosting : 给定初始训练数据,由此训练出第一个基学习器: 根据基学习器的表现对样本进行调整,在之前学习器做 ...
- h5css样式
兼容性前缀: 谷歌:webkit 火狐:moz ie:ms 欧鹏:o选择器: 属性选择器: * = 包含 {href * = 'www'} ^ = 以什么开头 $ = 以什么结尾 伪类选择器: 第一个 ...
- vuex的使用介绍
1.vuex是什么? vuex是一个专为vue.js应用程序开发的状态管理模式(它采用集中式存贮管理应用的所有组件的状态,并以相应的规则保证状态以一种可预测的方式发生变化). 2.vuex的核心概念? ...
- yum -y install 问题解决
1.错误如下: Last login: Thu Jul 26 09:04:14 2018 from 192.168.3.250[root@diagbot01 ~]# yum -y install do ...
- 1829:【02NOIP提高组】自由落体
#include<bits/stdc++.h> using namespace std; double h,s1,v,k,l; int n,ans; int main() { cin> ...
- ID生成算法(二)
上一篇文章介绍了一种用雪花算法生成GUID的方法,下面介绍里外一种生成GUID并导出为.txt文件的方法: 话不多少 show you the code ! <!DOCTYPE html> ...
- c++ rapidjson读取json文件 解析
库:链接:https://pan.baidu.com/s/1UChrgqLPJxKopyqShDCHjg 密码:3yhz #include <iostream> #include < ...