白手起家之分布式搜索 ES

基于开源的分布式,全文搜索引擎:
ELastic search
官网: https://www.elastic.co/cn/

下载:https://www.elastic.co/cn/downloads/elasticsearch

主要是用于数据的搜索,动态的查询.数据的过滤等';
数据分为:
结构化数据的,二维表的形式
非结构化的数据,图标
半结构化的数据 html,css.等语言信息
开始下载:
下载完成之后解压缩:



http://localhost:9200 9200 是一个客户端的启动端口
9300 端口为 Elasticsearch 集群间组件的通信端口,9200 端口为浏览器访问的 http
议 协议 RESTful 端口。

表示启动完成

将 bin/elssticSearche.bat 然后将数据请求一个地址
http://localhost:9200

es 启动成功 ,表示 Elastic search 成功启动;
es 遵守 RESTful 原则的开发, 幂等性一致,但是 post 不是
资源的转化,请求;
JSON 格式
Javascript object notation
var obj={ "name":"lucas"}

JSON 字符串:表示网络中传递的字符串的格式符合 JSON 格式
倒排索引:


es 基础操作:
创建一个 index(mysql 中的数据库 database)
创建索引:(发生 put 请求)
es 对于索引,支持 Get(获取),put(创建),delete(删除),



查看当前索引的信息:

查询一下全部索引的信息:

删除当前的索引:


创建文档:



上文有个唯一的标识; 也可以自定义完成,基于


查看你文档数据:

如何查询当前索引下全部的文档信息:


put/ 是全量更新
post 是局部更新;
删除文档:


版权声明: 本文为 InfoQ 作者【卢卡多多】的原创文章。
原文链接:【http://xie.infoq.cn/article/966cc0fbb07b6986b984aaea0】。文章转载请联系作者。
评论