Logo ByteGopher
Logo Inverted Logo
  • Tags
  • Bson
  • ElasticSearch
  • Go
  • HTTPS
  • Hbase
  • Hexo
  • Http
  • Mongo
  • Nginx
  • OpenTSDB
  • Raft
  • TSDB
  • Tips
  • Vim
Hero Image
「ElasticSearch」 ElasticSearch 简单查询

查询语句 query bool must exist “exists”: { “field”: “name” } 判断字段是否存在 must_not match “match”: { “tweet”: “elasticsearch” } 匹配字符串中是否包含 should Filter 简单查询 查询某个字段是否存在或者是否为null 1curl -H 'Content-type: application/json' -XPOST 'http://ip:9200/alert_group/_search' -d 1{ 2 "query": { 3 "bool": { 4 "must": { // must_not 5 "exists": { 6 "field": "name" // 必须存在该字段,且该字段不为null 7 } 8 } 9 } 10 } 11} 空查询(empty search) {}在功能上等价于使用 match_all 查询, 正如其名字一样,匹配所有文档: 1curl -X GET "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d' 2{ 3 "query": { 4 "match_all": {} 5 } 6} 7' Match 1GET /_search 2{ 3 "query": { 4 "match": { 5 "tweet": "elasticsearch" 6 } 7 } 8} 复合查询 组合多条件查询。elasticsearch提供bool来实现这种需求;

September 7, 2020 Read
Hero Image
「LogStash」LogStash安装

August 17, 2020 Read
Navigation
  • About
  • Skills
  • Recent Posts
  • My Story
Contact me:
  • renqiqiang@outlook.com

Stay up to date with email notification

By entering your email address, you agree to receive the newsletter of this website.

Toha Theme Logo Toha
© 2020-2022 Copyright.
Powered by Hugo Logo