Elastic Search 初探

1. ES 基础知识

Elasticsearch使用Lucene作为其核心来实现所有索引和搜索的功能,它通过简单的RESTful API来隐藏Lucene的复杂性,从而让全文搜索变得简单。

文档型数据库

倒排索引:

时间序列数据库的秘密 (2)——索引

Elasticsearch-基础介绍及索引原理分析

面向文档:

{
    "email":      "[email protected]",
    "first_name": "John",
    "last_name":  "Smith",
    "info": {
        "bio":         "Eco-warrior and defender of the weak",
        "age":         25,
        "interests": [ "dolphins", "whales" ]
    },
    "join_date": "2014/05/01"
}

 

 

 

 

 

 

 

 

1.4 ES数据架构的主要概念(与关系数据库Mysql对比)

Elastic Search 初探

关系数据库 ⇒ 数据库 ⇒ 表 ⇒ 行 ⇒ 列(Columns)

Elasticsearch ⇒ 索引(Index) ⇒ 类型(type) ⇒ 文档(Docments) ⇒ 字段(Fields)

 

使用ES的案例:

1) 2013年初,GitHub抛弃了Solr,采取ElasticSearch 来做PB级的搜索。 “GitHub使用ElasticSearch搜索20TB的数据,包括13亿文件和1300亿行代码”。

2)维基百科:启动以elasticsearch为基础的核心搜索架构。 
3)SoundCloud:“SoundCloud使用ElasticSearch为1.8亿用户提供即时而精准的音乐搜索服务”。 
4)百度:百度目前广泛使用ElasticSearch作为文本数据分析,采集百度所有服务器上的各类指标数据及用户自定义数据,通过对各种数据进行多维分析展示,辅助定位分析实例异常或业务层面异常。目前覆盖百度内部20多个业务线(包括casio、云分析、网盟、预测、文库、直达号、钱包、风控等),单集群最大100台机器,200个ES节点,每天导入30TB+数据。

维基百科、Stack Overflow、Github 都采用它