Elasticsearch tutorial(一)

一个分布式的RESTFUL风格的搜索和数据分析引擎

Elasticsearch is a highly scalable open-source full-text search and analytics engine. It allows you to store, search, and analyze big volumes of data quickly and in near real time. It is generally used as the underlying engine/technology that powers applications that have complex search features and requirements.

一个高度可扩展的开源全文搜索和分析引擎。它允许你近乎实时的快速存储、搜索和分析大量数据。它通常用作底层引擎/技术来为有着复杂搜索特性和需求的应用程序供能。

Here are a few sample use-cases that Elasticsearch could be used for:


这里列举了几个应用到Elasticsearch的简单用例:

You run an online web store where you allow your customers to search for products that you sell. In this case, you can use Elasticsearch to store your entire product catalog and inventory and provide search and autocomplete suggestions for them.

你运营一个允许用户搜索在售商品的在线商城。在该用例中,你可以使用Elasticsearch来存储你全部的商品品类和库存,并为你的客户提供搜索和自动补全搜索信息的推荐功能。

You want to collect log or transaction data and you want to analyze and mine this data to look for trends, statistics, summarizations, or anomalies. In this case, you can use Logstash (part of the Elasticsearch/Logstash/Kibana stack) to collect, aggregate, and parse your data, and then have Logstash feed this data into Elasticsearch. Once the data is in Elasticsearch, you can run searches and aggregations to mine any information that is of interest to you. 

你想收集日志或业务数据,并且对其进行分析、挖掘数据中存在的市场趋势、统计信息、摘要信息或反常情况。在该用例中,你可以用Logstash (Elasticsearch/Logstash/Kibana库中的一部分)来收集、合计、分析这些数据,然后通过Logstash将这些数据注入Elasticsearch.一旦数据存于Elasticsearch,你就可以进行搜索和聚合来挖掘你感兴趣的信息。

You run a price alerting platform which allows price-savvy customers to specify a rule like "I am interested in buying a specific electronic gadget and I want to be notified if the price of gadget falls below $X from any vendor within the next month". In this case you can scrape vendor prices, push them into Elasticsearch and use its reverse-search (Percolator) capability to match price movements against customer queries and eventually push the alerts out to the customer once matches are found.

你运营一个价格提醒平台。它允许一些精打细算的顾客指定规则,如:“我有意购买一个特定的电子产品,我希望本月若有任一卖家将价格降至X元以下时,收到平台的通知。”在这个案例中,你将抓取所有卖家给出的价格,将它们存入Elasticsearch中,使用Elasticsearch的反向检索(过滤器)性能来匹配价格变动以应对用户的查询,一旦发现匹配结果时就给用户弹出提醒。

You have analytics/business-intelligence needs and want to quickly investigate, analyze, visualize, and ask ad-hoc questions on a lot of data (think millions or billions of records). In this case, you can use Elasticsearch to store your data and then use Kibana (part of the Elasticsearch/Logstash/Kibana stack) to build custom dashboards that can visualize aspects of your data that are important to you. Additionally, you can use the Elasticsearch aggregations functionality to perform complex business intelligence queries against your data.

你有一个分析学或商业情报类的需求,希望快速调研、分析、图像化展示,并基于大量数据寻求特设问题(试想成百上千万的数据记录)。在这个用例中,你可以用Elasticsearch来存储数据,用Kibana(Elasticsearch/Logstash/Kibana库中的一部分)来建立自定义仪表板以便直观展现对你很重要的那部分数据。除此之外,你可以用Elasticsearch 的集成功能依据你的数据来呈现复杂的商业情报查询功能。


For the rest of this tutorial, you will be guided through the process of getting Elasticsearch up and running, taking a peek inside it, and performing basic operations like indexing, searching, and modifying your data. At the end of this tutorial, you should have a good idea of what Elasticsearch is, how it works, and hopefully be inspired to see how you can use it to either build sophisticated search applications or to mine intelligence from your data.

本教程的剩余内容,将指引你分步安装Elasticsearch并运行,小觑其中构造,完成像索引、搜索、修改数据等基本操作。本教程的结尾处,你将对Elasticsearch是什么有更好的认知、了解它是怎样工作的。我们无比希望你能使用它建造更精确的搜索应用亦或挖掘出你数据中的价值。

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 216,544评论 6 501
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,430评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 162,764评论 0 353
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,193评论 1 292
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,216评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,182评论 1 299
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,063评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,917评论 0 274
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,329评论 1 310
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,543评论 2 332
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,722评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,425评论 5 343
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,019评论 3 326
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,671评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,825评论 1 269
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,729评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,614评论 2 353

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,322评论 0 10
  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的阅读 13,470评论 5 6
  • 青衣沽酒客华年,雨色招帘,长街画眠。 诗笔阑珊终不厌,提笔墨点,红尘客栈。 萍水相逢话心缘,情字深浅,良人不眷。 ...
    素墨Y阅读 449评论 0 0
  • 时间是最好的见证,我喜欢用时间记录这一切 今天二零一七年十月二十六号 去年七月七号通过微信群加了一个男孩,偶尔聊聊...
    鱼遨游阅读 712评论 3 4
  • 昨天下班买菜,看到货架上赫然放着一把红苋菜,拿下来一看挺嫩的,就毫不犹豫买回家,想着周末在家炒红苋菜吃,很合适。 ...
    夏筠若阅读 1,510评论 18 19