Elastic Search 初探

本文介绍了Elasticsearch的基础知识,包括其如何使用Lucene实现高效搜索,文档型数据库的概念,以及倒排索引的工作原理。同时,文章还列举了Elasticsearch在实际场景中的应用案例,并与Solr和Sphinx进行了比较。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. ES 基础知识

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

文档型数据库

倒排索引:

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

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

面向文档:

{
    "email":      "john@smith.com",
    "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对比)

这里写图片描述

关系数据库 ⇒ 数据库 ⇒ 表 ⇒ 行 ⇒ 列(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 都采用它

ES与其他搜索引擎的对比

Solr VS ES

性能对比:

performanceCompare

ES vs Solr-vs-Sphinx

OPEN SOURCE SEARCH COMPARISON

Here is a brief comparison of Elasticsearch vs. Solr vs. Sphinx:

 

Elasticsearch

SolrSphinx
Types of Search Features

1. full-text 
2. autocomplete suggestions
3. faceted 
4. multifield
5. synonyms 
6. fuzzy
7. geospatial 
 

1. full-text 
2. autocomplete suggestions
3. faceted 
4. multifield
5. synonyms
6. fuzzy
7. highlighting
8. geospatial 
9. spell checker

1. full-text
2. autocomplete suggestions
3. faceted
4. multifield
5. synonyms (called wordforms)
6. geospatial
7. highlighting (called snippets)
8. spell checker (called qsuggest)

Real Time IndexingYesYesYes
PerformanceHighHighHigh
ScalabilityHighHighHigh
Data SchemeSchema-freeYes, but dynamicYes
Can be storageYesYesNo
Visualization of DataAllowed by the Elastic Stack (ES, Kibana, and Logstash)Allowed by Banana pluginNo
Machine LearningYesYesNo

solr

The major feature list includes:

  • Full-text search
  • Highlighting
  • Faceted search
  • Real-time indexing
  • Dynamic clustering
  • Database integration
  • NoSQL features and rich document handling (Word and PDF files, for example)

 

ES:

It offers a distributed,

multitenant-capable,

full-text search engine with an HTTP web interface (REST) and schema-free JSON documents.

The official client libraries for Elasticsearch are available in Java, Groovy, PHP, Ruby, Perl, Python, .NET, and Javascript

shards, and each shard can have multiple replicas

Elasticsearch is scalable with near real-time search

 JSON-based 

The major feature list includes:

  • Distributed search
  • Multi-tenancy
  • An analyzer chain
  • Analytical search
  • Grouping & aggregation

The Trend

 

 

solr vs elasticsearch

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值