0
LAMP人 主题分享交流会第12期:《新一代互联网行为定向广告技术的挑战与优化》            - 品友互动专场            www.LAMPER.cn            QQ群:83304912       http:/...
ElasticSearch A search engine “ready to fly”                                  Medcl/2012/2/18
About me• Medcl•   medcl@sina•   medcl@github•   m@medcl.net•   log.medcl.net
Why I am here?• 好东西需要与大家一起分享!
What’s elasticsearch• “Distributed, (Near) Real Time, Search Engine”•   Open Source(Apache 2.0)•   RESTful•   Free Schema(...
first impression
Let’s start the trip
Debug Tools
Index a documentcurl –XPOST http://localhost:9200/myindex/share/1-d’ Field                      字段内容      字段名称            ...
Index Response{    "ok": true,    "_index": "myindex",    "_type": "share",    "_id": "1",    "_version": 1}
Explain the url                              索引文档  服务器IP地址         索引名称                              唯一标识http://localhost:...
Query the document  ES服务器地址                 类型名称       指定查询条件curl –XGEThttp://localhost:9200/myindex/share/_search?q=locat...
Search Response{ "took": 12, "timed_out": false,   "_shards": {      "total": 5,   "successful": 5,   "failed": 0 },   "hi...
Querieshttp://localhost:9200/myindex/share/_search?q=beijinghttp://localhost:9200/myindex/share,conf/_search?q=beijinghttp...
QueryDSLcurl -XPOSThttp://localhost:9200/myindex/_search –d’{   "query": {                   Why QueryDSL?     "term": {  ...
Scalability&HA
Distributed Lucene Directory• Each index is fully sharded with a configurable  number of shards.• Each shard can have zero...
Automatic shard allocationFrom:http://www.slideshare.net/elasticsearch/elasticsearch-at-berlinbuzzwords-2010#
Scalability• nodes that can hold data, and nodes that do  not.• There is no need for a load balancer in  elasticsearch, ea...
Transaction log•   Indexed / deleted doc is fully persistent•   No need for a Lucene IndexWriter#commit•   Managed using a...
BASE• Each document you index is there once the  index operation is done.• No need to commit or something similar to  get ...
Not Mentioned Here…•   Versioning•   Template•   River                        That’s Too Much,•   Percolator          Disc...
Community&Support• http://github.com/elasticsearch• http://groups.google.com/group/elasticsearch• Irc:#elasticsearch@freen...
BTW• 招人in’  – 分布式  – 高性能  – 海量数据处理  – 个性化推荐            My  – 搜索引擎           Company!• 对以上任一感兴趣者:  – 欢迎加入我们的团伙!
Thank you!
曾勇 Elastic search-intro
曾勇 Elastic search-intro
Upcoming SlideShare
Loading in...5
×

曾勇 Elastic search-intro

2,292

Published on

#LAMP人#第12期《新一代互联网行为定向广告技术的挑战与优化- 品友互动专场》 – anyshare 之 曾勇

Published in: Technology, Business
2 Comments
2 Likes
Statistics
Notes
No Downloads
Views
Total Views
2,292
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
47
Comments
2
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "曾勇 Elastic search-intro"

  1. 1. LAMP人 主题分享交流会第12期:《新一代互联网行为定向广告技术的挑战与优化》 - 品友互动专场 www.LAMPER.cn QQ群:83304912 http://weibo.com/lampercn
  2. 2. ElasticSearch A search engine “ready to fly” Medcl/2012/2/18
  3. 3. About me• Medcl• medcl@sina• medcl@github• m@medcl.net• log.medcl.net
  4. 4. Why I am here?• 好东西需要与大家一起分享!
  5. 5. What’s elasticsearch• “Distributed, (Near) Real Time, Search Engine”• Open Source(Apache 2.0)• RESTful• Free Schema(Dynamic)• MultiTenant• Scalable• High Availability• Rich Search Features• Good Expansibility• ……
  6. 6. first impression
  7. 7. Let’s start the trip
  8. 8. Debug Tools
  9. 9. Index a documentcurl –XPOST http://localhost:9200/myindex/share/1-d’ Field 字段内容 字段名称 RESTful{ URL地址 "url" : "http://www.lamper.cn/", "date" : "2012-02-18 13:00:00", "location" : "beijing,北京"}’ 索引文档内容, Json格式
  10. 10. Index Response{ "ok": true, "_index": "myindex", "_type": "share", "_id": "1", "_version": 1}
  11. 11. Explain the url 索引文档 服务器IP地址 索引名称 唯一标识http://localhost:9200/myindex/share/1 HTTP端口 索引类型名称
  12. 12. Query the document ES服务器地址 类型名称 指定查询条件curl –XGEThttp://localhost:9200/myindex/share/_search?q=location:beijing 索引名称 搜索RESTful接口 查询条件, 字段名:值
  13. 13. Search Response{ "took": 12, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 1, "max_score": 0.5, "hits": [ { "_index": "myindex", "_type": "share", "_id": "1", "_score": 0.5, "_source": { "url": "http://www.lamper.cn/", "date": "2012-02-18 13:00:00", "location": "beijing,北京" } } ] }}
  14. 14. Querieshttp://localhost:9200/myindex/share/_search?q=beijinghttp://localhost:9200/myindex/share,conf/_search?q=beijinghttp://localhost:9200/myindex/_search?q=beijinghttp://localhost:9200/myindex,myindex2/_search?q=beijinghttp://localhost:9200/_search?q=beijing
  15. 15. QueryDSLcurl -XPOSThttp://localhost:9200/myindex/_search –d’{ "query": { Why QueryDSL? "term": { Filters、Caching、 "location": "beijing" Highlighting、Facet、 ComplexQuery } …… }}’
  16. 16. Scalability&HA
  17. 17. Distributed Lucene Directory• Each index is fully sharded with a configurable number of shards.• Each shard can have zero or more replicas.• Read / Search operations performed on either replica shard.
  18. 18. Automatic shard allocationFrom:http://www.slideshare.net/elasticsearch/elasticsearch-at-berlinbuzzwords-2010#
  19. 19. Scalability• nodes that can hold data, and nodes that do not.• There is no need for a load balancer in elasticsearch, each node can receive a request, and if it can’t handle it, it will automatically delegate it to the appropriate node(s).• If you want to scale out search, you can simply have more shard replicas per shard.
  20. 20. Transaction log• Indexed / deleted doc is fully persistent• No need for a Lucene IndexWriter#commit• Managed using a transaction log / WAL• Full single node durability (kill dash 9)• Utilized when doing hot relocation of shards• Periodically “flushed” (calling IW#commit)
  21. 21. BASE• Each document you index is there once the index operation is done.• No need to commit or something similar to get everything persisted.• A shard can have 1 or more replicas for HA.• Gateway persistency is done in the background in an async manner.
  22. 22. Not Mentioned Here…• Versioning• Template• River That’s Too Much,• Percolator Discovery it yourself• PartialUpdate• Routing• Parent-Child Type• Scripting• ……
  23. 23. Community&Support• http://github.com/elasticsearch• http://groups.google.com/group/elasticsearch• Irc:#elasticsearch@freenode• qq群:190605846• http://doc.elasticsearch.cn• http://s.medcl.net/
  24. 24. BTW• 招人in’ – 分布式 – 高性能 – 海量数据处理 – 个性化推荐 My – 搜索引擎 Company!• 对以上任一感兴趣者: – 欢迎加入我们的团伙!
  25. 25. Thank you!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×