Your SlideShare is downloading. ×
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
曾勇 Elastic search-intro
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

曾勇 Elastic search-intro

2,254

Published on

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

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

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

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. LAMP人 主题分享交流会第12期:《新一代互联网行为定向广告技术的挑战与优化》 - 品友互动专场 www.LAMPER.cn QQ群:83304912 http://weibo.com/lampercn
  • 2. ElasticSearch A search engine “ready to fly” Medcl/2012/2/18
  • 3. About me• Medcl• medcl@sina• medcl@github• m@medcl.net• log.medcl.net
  • 4. Why I am here?• 好东西需要与大家一起分享!
  • 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. first impression
  • 7. Let’s start the trip
  • 8. Debug Tools
  • 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. Index Response{ "ok": true, "_index": "myindex", "_type": "share", "_id": "1", "_version": 1}
  • 11. Explain the url 索引文档 服务器IP地址 索引名称 唯一标识http://localhost:9200/myindex/share/1 HTTP端口 索引类型名称
  • 12. Query the document ES服务器地址 类型名称 指定查询条件curl –XGEThttp://localhost:9200/myindex/share/_search?q=location:beijing 索引名称 搜索RESTful接口 查询条件, 字段名:值
  • 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. 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. QueryDSLcurl -XPOSThttp://localhost:9200/myindex/_search –d’{ "query": { Why QueryDSL? "term": { Filters、Caching、 "location": "beijing" Highlighting、Facet、 ComplexQuery } …… }}’
  • 16. Scalability&HA
  • 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. Automatic shard allocationFrom:http://www.slideshare.net/elasticsearch/elasticsearch-at-berlinbuzzwords-2010#
  • 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. 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. 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. Not Mentioned Here…• Versioning• Template• River That’s Too Much,• Percolator Discovery it yourself• PartialUpdate• Routing• Parent-Child Type• Scripting• ……
  • 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. BTW• 招人in’ – 分布式 – 高性能 – 海量数据处理 – 个性化推荐 My – 搜索引擎 Company!• 对以上任一感兴趣者: – 欢迎加入我们的团伙!
  • 25. Thank you!

×