`
knight_black_bob
  • 浏览: 823730 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

elastic search head 基本用法

阅读更多

 

elastic search head 基本用法

 

es 安装方法: http://knight-black-bob.iteye.com/blog/2259836

 

 

 

 

资源监控和集群管理插件 

 

bin/plugin -install lukas-vlcek/bigdesk
http://192.168.13.140:9200/_plugin/bigdesk

 

 数据查询插件

 

bin/plugin -install mobz/elasticsearch-head
http://192.168.13.140:9200/_plugin/head/

 

 

理解性:

   _index  类似 mysql中 database

   _type   类似  mysql 中 table

   _ id     类似  mysql 中 id

 

 

插入测试数据

使用 put   http://192.168.13.140:9200/baoyou/10120/17_2/

 {

  "token_id": 17,

  "type_id": 1,

  "tag_desc": "test data",

  "insert_time": "20151202",

  "tag_id": 2

}

使用 put   http://192.168.13.140:9200/baoyou/10120/17_1/

 {

  "token_id": 17,

  "type_id": 1,

  "tag_desc": "test data",

  "insert_time": "20151202",

  "tag_id": 1

}

 



 

 

2.删除数据



 

 

3.查询语句

 

{
  "size": 5,
  "query": {
    "bool": {
      "should": [
        {
          "match": {
            "tag_id": 2
          }
        },
        {
          "match": {
            "tag_id": 1
          }
        }
      ]
    }
  },
  "aggs": {
    "hello": {
      "terms": {
        "field": "token_id"
      }
    }
  }
}

 



 

 

4.更新数据



 

 

更新数据 version 有所改变

 

 

 elastic search head 基本用法2

 

{
  "size": 0,
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "os": "iOS"
          }
        }
      ]
    }
  },
  "aggs": {
    "hello": {
      "terms": {
        "field": "device_resolution"
      }
    }
  }
}

 

{
"took": 23,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 25187,
"max_score": 0,
"hits": [ ]
},
"aggregations": {
"hello": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "667*375",
"doc_count": 9379
}
,
{
"key": "568*320",
"doc_count": 8302
}
,
{
"key": "736*414",
"doc_count": 4475
}
,
{
"key": "480*320",
"doc_count": 3030
}
,
{
"key": "755*425",
"doc_count": 1
}
]
}
}
}

 

 1. term  分词



 

 

 

 term 分词, long int 类型 , 17 的 分词就是 17 , string 类型 为 空格 分割的单词 。 test data 分词之后是 test ,data . 【test data】 不是

 

 

    1. {"query":{"bool":{"must":[{"term":{"10120.tag_desc":"data"}}],"must_not":[],"should":[{"term":{"10120.tag_desc":"test"}}]}},"from":0,"size":10,"sort":[],"facets":{}}:


     

 

 

2.range

 

  1. {"query":{"bool":{"must":[{"range":{"10120.token_id":{"from":"1","to":"18"}}}],"must_not":[],"should":[]}},"from":0,"size":10,"sort":[],"facets":{}}:

 

 

 range 区间 范围 只对整形 有作用 ,string 无效。

 

 

3.fuzzy

    1. {"query":{"bool":{"must":[],"must_not":[],"should":[{"fuzzy":{"10120.token_id":{"value":"1","min_similarity":"20"}}}]}},"from":0,"size":10,"sort":[],"facets":{}}:
  1.  

     fuzzy  区间    value +- min_similarity   本 实例中   是  -19 ~21 之间。

 

 4.query_string

 

 

 

 



 

query_string  可以对 int long string 进行 查询。

   对 int long 只能 本身查询

   对 string 进行 分词查询  本身 也可以查询。

 

 

 5. miss

   对 那列中 没有 值的列 进行显示。

 

 6. prefix



 prefix 前缀查询

 

7. wildcard

    1. {"query":{"bool":{"must":[],"must_not":[],"should":[{"wildcard":{"10120.tag_desc":"t*"}}]}},"from":0,"size":10,"sort":[],"facets":{}}:


     

 wildcard 通配符

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

捐助开发者

在兴趣的驱动下,写一个免费的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(右上角的爱心标志,支持支付宝和PayPal捐助),没钱捧个人场,谢谢各位。



 
 
 谢谢您的赞助,我会做的更好!

 

 

  • 大小: 52.1 KB
  • 大小: 12 KB
  • 大小: 383.8 KB
  • 大小: 38.9 KB
  • 大小: 107.2 KB
  • 大小: 99.6 KB
  • 大小: 109 KB
  • 大小: 105.1 KB
  • 大小: 25.7 KB
  • 大小: 24.3 KB
  • 大小: 22.8 KB
  • 大小: 23.9 KB
  • 大小: 25.7 KB
  • 大小: 24.3 KB
  • 大小: 16.1 KB
  • 大小: 22.6 KB
  • 大小: 23.9 KB
0
0
分享到:
评论

相关推荐

    浏览器elasticsearch-head插件安装方法.rar

    由于谷歌浏览器下载elasticsearch-head插件需要,所以下载不是很方便。但是附件内浏览器可以直接安装拓展程序,方便快捷,可用,谢谢使用。由于谷歌浏览器下载elasticsearch-head插件需要,所以下载不是很方便。但是...

    elasticsearch-head 可视化界面

    elasticsearch-head 主要是es可视化插件,解压后。在谷歌浏览器拓展中放进去 使用方法:在谷歌浏览器右上角点击elasticsearch-head 既可以显示可视化界面。

    最新版本springboot集成elasticsearch

    一般来说我们开发Elasticsearch会选择使用集成springboot,在网上找的springboot集成elasticsearch文章几乎都是extends ElasticsearchRepository的方式来实现。但是新版本ElasticsearchRepository里的方法基本上已经...

    elasticsearch及其链接工具使用方法.zip

    elasticsearch和elasticsearch-head-master包安装及其使用

    ElasticSearch个人详细总结

    elasticsearch安装部署 Head插件使用方法 集成IK分词器 ES Java API(5种连接方式:节点客户端,传输客户端,RestClient,Spring Data ElasticSearch,Jest)

    十次方-elasticsearch详解

    内容包含: ...Head插件安装,Head插件的基本使用方法 IK分词器的安装 使用SpringDataElasticsearch完成搜索微服务的开发 logstash完成mysql与Elasticsearch的同步工作 Elasticsearch在docker下的安装

    es-head Elasticsearch的可视化操作插件

    es-head 插件可以在谷歌浏览器中使用,以下是使用方法: 1.下载解压 es-head 插件。你可以从相关网站下载 es-head 插件的压缩包,然后解压。 2.将解压后的插件文件放入 Chrome 扩展程序目录。可以参考谷歌浏览器右...

    ElasticSearch6.2.3+head插件安装的方法步骤

    主要介绍了ElasticSearch6.2.3+head插件安装的方法步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

    elastic-searchui-webcomponents:使用Lit-Element的Elastic search-ui的Webcomponent实现

    使用的Elastic Search UI( )的演示Web组件实现 用法 将脚本添加到您的head或body标签: [removed][removed] 在body标签内添加component标签: < search-provider config =' { "debug": true, "apiConnector":...

    ELK 之 Elasticsearch的插件head/kopf/bigdesk(使用篇)

    使用PUT方法增加数据 使用POST修改数据 使用GET查询数据 使用DELETE删除数据 增加数据 root@es1 bin]# curl -X PUT http://192.168.1.11:9200/home/tan/1 -d '{ > 职业:诗人, > 名字:李白, > 称号:诗仙, > 年代:唐 >...

    kendo-elasticsearch

    它支持在ElasticSearch中对日期和字符串字段进行过滤,搜索和排序。 不故意支持其他方案,也未经过测试。 用法 这是一个示例HTML文件,该文件定义了与ElasticSearch对话的Kendo网格: <!DOCTYPE html> <...

    简介JavaScript中search()方法的使用

    此方法执行搜索正则表达式,String对象之间的匹配。 语法 string.search(regexp); 下面是参数的详细信息: regexp : 正则表达式对象。如果非RegExp对象obj传递,它是隐式通过使用new RegExp(obj) 转换为RegExp ...

    ES-CURL命令使用 - 副本.docx

    Elasticsearch-CURL:curl -H "Content-Type: application/json" -u username:password -X指定http请求的方法(如HEAD GET POST PUT DELETE)httpUrl -d '指定要传输的数据'

    grafana-authentication-proxy:Grafana 身份验证代理

    Elasticsearch、grafana 和用户客户端之间的代理支持基本认证保护的 Elasticsearch,只有 grafana-authentication-proxy 知道用户/密码兼容最新的grafana 增强的身份验证方法。 现在支持客户端的 Google OAuth2、...

Global site tag (gtag.js) - Google Analytics