Successfully reported this slideshow.

Elastic search intro-@lamper

2

Share

Upcoming SlideShare
曾勇 Elastic search-intro
曾勇 Elastic search-intro
Loading in …3
×
1 of 26
1 of 26

Elastic search intro-@lamper

2

Share

Download to read offline

Description

lamper 2012/02/18 anyshare

Transcript

  1. 1. ElasticSearch A search engine “ready to fly” Medcl/2012/2/18
  2. 2. About me • Medcl • medcl@sina • medcl@github • m@medcl.net • log.medcl.net
  3. 3. Why I am here? • 好东西需要与大家一起分享!
  4. 4. 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 Extensibility • ……
  5. 5. first impression
  6. 6. Let’s start the trip
  7. 7. Debug Tools
  8. 8. 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格式
  9. 9. Index Response { "ok": true, "_index": "myindex", "_type": "share", "_id": "1", "_version": 1 }
  10. 10. Explain the url 索引文档 服务器IP地址 索引名称 唯一标识 http://localhost:9200/myindex/share/1 HTTP端口 索引类型名称
  11. 11. Query the document ES服务器地址 类型名称 指定查询条件 curl –XGET http://localhost:9200/myindex/share/_search?q =location:beijing 索引名称 搜索RESTful接口 查询条件, 字段名:值
  12. 12. 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,北京" } } ] }}
  13. 13. 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
  14. 14. QueryDSL curl -XPOST http://localhost:9200/myindex/_search –d’ { "query": { Why QueryDSL? "term": { Filters、Caching、 "location": "beijing" Highlighting、Facet、 ComplexQuery } …… } }’
  15. 15. Scalability&HA
  16. 16. 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.
  17. 17. Automatic shard allocation From:http://www.slideshare.net/elasticsearch/elasticsearch-at-berlinbuzzwords-2010#
  18. 18. 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.
  19. 19. 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)
  20. 20. 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.
  21. 21. Not Mentioned Here… • Versioning • Template • River That’s Too Much, • Percolator Discovery it yourself • PartialUpdate • Routing • Parent-Child Type • Scripting • ……
  22. 22. 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/
  23. 23. BTW • 招人in’ – 分布式 – 高性能 – 海量数据处理 – 个性化推荐 My – 搜索引擎 Company! • 对以上任一感兴趣者: – 欢迎加入我们的团伙!
  24. 24. Thank you!

Description

lamper 2012/02/18 anyshare

Transcript

  1. 1. ElasticSearch A search engine “ready to fly” Medcl/2012/2/18
  2. 2. About me • Medcl • medcl@sina • medcl@github • m@medcl.net • log.medcl.net
  3. 3. Why I am here? • 好东西需要与大家一起分享!
  4. 4. 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 Extensibility • ……
  5. 5. first impression
  6. 6. Let’s start the trip
  7. 7. Debug Tools
  8. 8. 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格式
  9. 9. Index Response { "ok": true, "_index": "myindex", "_type": "share", "_id": "1", "_version": 1 }
  10. 10. Explain the url 索引文档 服务器IP地址 索引名称 唯一标识 http://localhost:9200/myindex/share/1 HTTP端口 索引类型名称
  11. 11. Query the document ES服务器地址 类型名称 指定查询条件 curl –XGET http://localhost:9200/myindex/share/_search?q =location:beijing 索引名称 搜索RESTful接口 查询条件, 字段名:值
  12. 12. 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,北京" } } ] }}
  13. 13. 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
  14. 14. QueryDSL curl -XPOST http://localhost:9200/myindex/_search –d’ { "query": { Why QueryDSL? "term": { Filters、Caching、 "location": "beijing" Highlighting、Facet、 ComplexQuery } …… } }’
  15. 15. Scalability&HA
  16. 16. 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.
  17. 17. Automatic shard allocation From:http://www.slideshare.net/elasticsearch/elasticsearch-at-berlinbuzzwords-2010#
  18. 18. 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.
  19. 19. 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)
  20. 20. 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.
  21. 21. Not Mentioned Here… • Versioning • Template • River That’s Too Much, • Percolator Discovery it yourself • PartialUpdate • Routing • Parent-Child Type • Scripting • ……
  22. 22. 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/
  23. 23. BTW • 招人in’ – 分布式 – 高性能 – 海量数据处理 – 个性化推荐 My – 搜索引擎 Company! • 对以上任一感兴趣者: – 欢迎加入我们的团伙!
  24. 24. Thank you!

More Related Content

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

×