Ce diaporama a bien été signalé.
Le téléchargement de votre SlideShare est en cours. ×

曾勇 Elastic search-intro

Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Prochain SlideShare
Elastic search intro-@lamper
Elastic search intro-@lamper
Chargement dans…3
×

Consultez-les par la suite

1 sur 27 Publicité

Plus De Contenu Connexe

Diaporamas pour vous (20)

Publicité

Similaire à 曾勇 Elastic search-intro (20)

Plus par Shaoning Pan (20)

Publicité

Plus récents (20)

曾勇 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 document curl –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 –XGET http://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. Queries http://localhost:9200/myindex/share/_search?q= beijing http://localhost:9200/myindex/share,conf/_searc h?q=beijing http://localhost:9200/myindex/_search?q=beijing http://localhost:9200/myindex,myindex2/_search ?q=beijing http://localhost:9200/_search?q=beijing
  15. 15. QueryDSL curl -XPOST http://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 allocation From: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!

×