Elasticsearch简称ES。

是一个全文搜索服务器,也可作为NoSQL数据库,存储任意格式的文档和数据,也可做大数据的分析,是一个跨界开源产品。

ES的特点:

  全文搜索引擎

  文档存储和查询

  大数据分析

  提供了REST API,用来简化对ES的操作

  常常配合传统数据库一起使用,ES用来负责大数据的查询、搜索、统计分析

1.下载

elasticsearch-6.8.3.zip  https://www.elastic.co/downloads/past-releases#elasticsearch

2.启动

解压 elasticsearch-6.8.3.zip

打开cmd,进入elasticsearch的bin

elasticsearch

9200端口是对外的RESTFul接口,9300端口是ES内部使用的端口

启动后在浏览器 http://localhost:9200/

说明:

  name代表这台ES的名字

  cluster_name默认名字是elasticsearch。ES的集群方式是通过广播在同一个网络中寻找cluster_name一样的ES

  如果想修改配置,可以在config/elasticsearch.yml配置

3.基本概念

  Index:是Document的集合,Index包含了Type,相当于数据库

  Type:用来进一步组织Document,一个Index可以有多个Type,相当于表

  Document:文档,是ES能够存储和搜索的基本信息,Document属于Type,相当于行数据,json格式的

  Node:节点,是集群里的一台ES Server,用于Document的存储和查询

  Shards:分区,Index超过了单个节点存储的限制,就会将Index进行分区

  Replicas:复制分区,将Index分为多个分区,Index的分区为主分区,复制的分区为复制分区

4.基本使用

  (1)添加文档

curl -XPOST 'localhost:9200/store/category/1?pretty' -H 'Content-type:application/json' -d'{"name":"soap","type":"cleaning","postDate":"2019-9-15","message":"this is a first data"}'

  (2)根据主键查询

curl -XGET 'localhost:9200/store/category/1?pretty'

  (3)根据主键更新

 curl -XPUT 'localhost:9200/store/category/1?pretty' -H 'Content-type:application/json' -d'{"name":"soap123","type":"cleaning","postDate":"2019-9-15T23:10:10","message":"update data"}'

  只更新message

curl -XPOST 'localhost:9200/store/category/1?pretty' -H 'Content-type:applicat                                                                                                                ion/json' -d'{"doc":{"message":"only update message"}}'

  (4)根据主键删除

curl -XDELETE 'localhost:9200/store/category/1?pretty'

  (5)搜索

curl -XPOST 'localhost:9200/store/category/_search?pretty'

    全文搜索

 curl -XPOST 'localhost:9200/store/category/_search?pretty' -H 'Content-type:application/json' -d'{"query":{"match":{"message":"data"}}}'

    精确搜索

curl -XPOST 'localhost:9200/store/category/_search?pretty' -H 'Content-type:application/json' -d'{"query":{"term":{"type":"cleaning"}}}'

    查询总数

  将_count替换_search

curl -XPOST 'localhost:9200/store/category/_count?pretty' -H 'Content-type:application/json' -d'{"query":{"match":{"message":"data"}}}'

    联合查询

curl -XPOST 'localhost:9200/store/category/_search?pretty' -H 'Content-type:application/json' -d'{"query":{"bool":{"must":[{"term":{"type":"eating"}},{"match":{"message":"second"}}]}}}'

    翻页,使用from和size

 curl -XPOST 'localhost:9200/store/category/_search?pretty' -H 'Content-type:application/json' -d'{"from":1,"size":1,"query":{"match":{"message":"data"}}}'

说明:

  安装了git就会带有curl功能了

数据可视化

Elasticsearch在windows上安装与使用的更多相关文章

  1. Elasticsearch在windows上安装好了之后怎么使用?

    windows 10上安装Elasticsearch过程记录 一.安装和配置Java JDK1.下载:http://download.oracle.com/otn ... 4.exe2.设置环境变量: ...

  2. 在Windows上安装Elasticsearch 5.0

    在windows上安装Elasticsearch Elasticsearch可以使用.zip软件包安装在Windows上. elasticsearch-service.bat命令,它将设置Elasti ...

  3. 在Windows上安装Elasticsearch 5.x

    在Windows上安装Elasticsearch 5.x 自己想学习Elasticsearch,但是又不懂Linux,按照同事给的Linux安装教程,也是搞不明白,于是想先在Windows上安装一下入 ...

  4. ElasticSearch | windows 上安装ES

    Elastatic需要java JAVA8 环境,确保安装好环境 在windows上安装ES还是比较简单的, 1.首先在官网上下载zip,地址 https://www.elastic.co/downl ...

  5. Windows上安装ElasticSearch7的IK分词器

    首先IK分词器和ES版本一定要严格对应,下面是版本对照表 IK分词器下载地址 https://github.com/medcl/elasticsearch-analysis-ik/releases 我 ...

  6. Windows上安装ElasticSearch7

    安装JDK1.8(包括)以上版本 安装ElasticSearch ElasticSearch下载地址: https://www.elastic.co/downloads/elasticsearch 双 ...

  7. 在windows上安装elasticsearch7.6

    在windows上安装elasticsearch7.6 安装Java1.8 下载Java1.8 提取码:yi0c 链接:https://pan.baidu.com/s/1mNd2Yg-k6ob91bO ...

  8. 在 Windows 上安装Rabbit MQ 指南

    rabbitMQ是一个在AMQP协议标准基础上完整的,可服用的企业消息系统.他遵循Mozilla Public License开源协议.采用 Erlang 实现的工业级的消息队列(MQ)服务器. Ra ...

  9. 在Windows上安装虚拟机详细图文教程

    用虚拟机来安装最新的软件,安装最新的系统等等比较保险,可以避免安装不顺利影响自己原来的系统和应用,想尝鲜又担心自己完全更换系统不适应的朋友可以尝试. 虚拟机下载:https://yunpan.cn/c ...

随机推荐

  1. 重装Zend Studio后如何恢复之前的设置

    Program Files (x86)\Zend\Zend Studio 10.0.0\configuration\.settings 这个目录下的文件备份下来,重装安装Zend Studio后覆盖到 ...

  2. 【大数据】Hadoop单机安装配置

    1.解压缩hadoop-2.7.6.tar.gz到/home/hadoop/Soft目录中 2.创建软链接,方便hadoop升级  ln -s /home/hadoop/Soft/hadoop-2.7 ...

  3. Maven 学习(一)-Maven 使用入门

    http://www.cnblogs.com/xdp-gacl/p/3498271.html http://www.cnblogs.com/xdp-gacl/p/4240930.html 一.Mave ...

  4. Ping任务管理模块-JavaWeb

    总体框架: 1.创建任务 2.修改任务 3.删除任务 4.环境配置 5.全量PING 6.抽样PING 7.停止 8.查看历史 9.查看执行详情 主要从项目总结和经验角度讲述: 一.项目运行环境 1. ...

  5. SpringBoot Ajax跨域问题(session共享问题)

    ajax 发送post请求至springBoot出现跨域问题 需要在springBoot加上注解  @CrossOrigin 就能解决 报错信息 前端js代码 如果用上面的方式,session不能共享 ...

  6. linux 查看硬盘使用情况

    在windows系统中,我们可以很容易的查看磁盘的使用情况,在linux系统中,我们可以使用命令来查看磁盘使用情况. 1.df命令 作用:用来查看硬盘的挂载点,以及对应的硬盘容量信息.包括硬盘的总大小 ...

  7. 兑换零钱-(dp)

    https://ac.nowcoder.com/acm/contest/910/B 本以为是组合数,没想到是dp求解,变成水题了,让我想起了第一次见到dp的爬楼梯,可以走一步和走两步,走40步,这里相 ...

  8. java之Matcher类详解

    在JDK 1.4中,Java增加了对正则表达式的支持. java与正则相关的工具主要在java.util.regex包中:此包中主要有两个类:Pattern.Matcher. Matcher  声明: ...

  9. Splay&LCT

    Splay && LCT \(\text{Splay}\) 基本操作 1.\(Zig \& Zag\) 其思想是维护中序遍历不变 实现中我们不真的用\(Zig\)或\(Zag\ ...

  10. MongoDB shell 0 集合方法

    方法名 描述 db.collection.aggregate() 聚合,主要用于处理数据(诸如统计平均值,求和等),并返回计算后的数据结果 db.collection.bulkWrite() 批量写入 ...