ES技巧
2,
统计字段b的不同值的数量
{"size":0,"aggs":{"distinct_colors":{"cardinality":{"field":"b"}}}}
统计字段Local_ip的不同值
{"size":0,"aggs":{"langs":{"terms":{"field":"Local_ip","size":50000000}}}}
3,
GET /products5/_search
{"query":{"match":{"name":"led tv"}},"aggs":{"resellers":{"nested":{"path":"resellers"},"aggs":{"langs":{"terms":{"field":"resellers.price","size":50000000}}}}}}
GET /products5/_search
{"query":{"bool":{"must":[],"must_not":[],"should":[],"filter":[{"nested":{"path":"resellers","query":{"bool":{"must":[{"term":{"resellers.price":44}}],"must_not":[],"should":[],"filter":[]}}}}]}},"from":0,"size":10,"sort":[]}
4,
PUT /products5/_doc/13
{"name":"LED TV","resellers":[{"price":101},{"price":110},{"price":130}],"date":"2015/02/01 05:02:00"}
GET /products5/_search
{"query":{"match":{"name":"led tv"}},"aggs":{"sales_per_month":{"date_histogram":{"field":"date","fixed_interval":"60m"},"aggs":{"resellers":{"nested":{"path":"resellers"},"aggs":{"sales":{"terms":{"field":"resellers.price","size":50000000}}}}}}}}
ES 分页
https://www.elastic.co/guide/cn/elasticsearch/guide/current/pagination.html
https://www.elastic.co/guide/en/elasticsearch/reference/6.4/search-request-from-size.html
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from-size.html
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html
ES技巧的更多相关文章
- 白日梦的Elasticsearch实战笔记,ES账号免费借用、32个查询案例、15个聚合案例、7个查询优化技巧。
目录 一.导读 二.福利:账号借用 三._search api 搜索api 3.1.什么是query string search? 3.2.什么是query dsl? 3.3.干货!32个查询案例! ...
- Elasticsearch必知必会的干货知识二:ES索引操作技巧
该系列上一篇文章<Elasticsearch必知必会的干货知识一:ES索引文档的CRUD> 讲了如何进行index的增删改查,本篇则侧重讲解说明如何对index进行创建.更改.迁移.查询配 ...
- 一次看完28个关于ES的性能调优技巧,很赞,值得收藏!
因为总是看到很多同学在说Elasticsearch性能不够好.集群不够稳定,询问关于Elasticsearch的调优,但是每次都是一个个点的单独讲,很多时候都是case by case的解答,本文简单 ...
- ES ik分词器使用技巧
match查询会将查询词分词,然后对分词的结果进行term查询. 然后默认是将每个分词term查询之后的结果求交集,所以只要分词的结果能够命中,某条数据就可以被查询出来,而分词是在新建索引时指定的,只 ...
- ES doc_values介绍——本质是field value的列存储,做聚合分析用,ES默认开启,会占用存储空间(列存储压缩技巧,除公共除数或者同时减去最小数,字符串压缩的话,直接去重后用数字ID压缩)
doc_values Doc values are the on-disk data structure, built at document index time, which makes this ...
- iOS----调试技巧,让你的开发事半功倍
NSLog,po命令和普通断点调试相信每个iOS开发者都会,这里就不作介绍了. 一.Memory Graph Xcode8新增:Memory Graph解决闭包引用循环问题 这个时候就进入了断点模式, ...
- ES搜索引擎-简单入门
基本概念: 索引Index es吧数据放到一个或者多个索引中,如果用关系型数据库模型对比,索引的地位与数据库实例(db)相当.索引存放和读取的基本单元是文档(document).es内部使用的是apa ...
- iOS-------应用性能调优的25个建议和技巧
性能对 iOS 应用的开发尤其重要,如果你的应用失去反应或者很慢,失望的用户会把他们的失望写满App Store的评论.然而由于iOS设备的限制,有时搞好性能是一件难事.开发过程中你会有很多需要注意的 ...
- Elaticsearch REST API常用技巧
在Elasticsearch的REST API中,有很多使用技巧,这里针对官方文档给出的介绍,总结了几个常用的例子. 更多内容参考:Elastisearch文档总结 多索引 ES支持在一次请求中指定多 ...
随机推荐
- docker建镜像
docker建镜像 # build docker build -t $(BASE):$(TAG) -f run.docker . Dockerfile Dockerfile是自定义镜像的一个重要帮手, ...
- Lnmp环境安装禅道项目管理软件
1.本地环境 CentOS Linux release 7.5.1804 (Core) PHP 7.1.0-dev (cli) mysql Ver 14.14 Distrib 5.7.22 nginx ...
- Werkzeug——python web开发工具包
转载请注明原文地址:https://www.cnblogs.com/ygj0930/p/10826062.html 一:Werkzeug是个啥 1)Werkzeug是一个工具包,它封装了很多东西,诸如 ...
- Python时间模块。
python中时间的表示方式 unix时间戳,字符串时间,格式化时间 时间模块有,time,datetime,calendar #time模块 import time #获取本地时间戳,返回浮点数 p ...
- php72w-common conflicts with php-common-5.4.16-46.el7.x86_64
安装PHP的BC扩展时,报的错. 使用的命令为 yum install php-bcmath 输出错误: --> Processing Conflict: php72w-common--.w7. ...
- httprunner学习23-加解密
前言 有些接口的请求参数是加密的,返回的接口内容也是需要解密才能看到. 加密接口 比如当我们访问下面这个登陆的接口时,请求参数账号和密码都是需要加密,通过parms参数传过去,服务器才能识别到 没加密 ...
- 图像处理中Stride和Width的关系
一行有 11 个像素(Width = 11), 对一个 32 位(每个像素 4 字节)的图像, Stride = 11 * 4 = 44. 但还有个字节对齐的问题, 譬如: 一行有 11 个像素(Wi ...
- java.lang.IllegalArgumentException: An invalid character [34] was present in the Cookie value
java.lang.IllegalArgumentException: An invalid character [34] was present in the Cookie value at org ...
- 运行 npm run lint -- --fix,提示:error Use the global form of 'use strict'
运行 npm run lint -- --fix,提示:error Use the global form of 'use strict',使用说明网址:https://eslint.org/docs ...
- hook杂思-面向函数编程
hook:方法拦截 以函数单元为编程对象: 在编译时或运行时进行函数单元的替代.修改.功能添加操作: 所有的操作都不是在原始编码时完成的: 函数单元作为参量.操作对象.编码对象存在于机制中: 机制: ...