Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Elastic search adaptto2014

3,935 views

Published on

Integrating ElasticSearch with AEM/CQ5.

Published in: Software

Elastic search adaptto2014

  1. 1. APACHE SLING & FRIENDS TECH MEETUP BERLIN, 22-24 SEPTEMBER 2014 Integrating ElasticSearch with AEM Vivek Sachdeva, Intelligrape Software @vivek_sach
  2. 2. Agenda  Introduction to ElasticSearch  Analyzing Data  Integration with AEM  Approaches Considered  Features Integrated  Extension Points adaptTo() 2014 2
  3. 3. About Me :)  Started career as Java Developer in 2010  Worked on Groovy and Grails  Currently working as AEM(plus Groovy) Developer  Intelligrape Software  vivek.sachdeva@intelligrape.com  in.linkedin.com/pub/vivek-sachdeva/20/192/934/ adaptTo() 2014 3
  4. 4. Elastic Search – An Introduction adaptTo() 2014 4
  5. 5. What & Why??  ElasticSearch is a distributed, RESTful, free/open source search server  Based on Apache Lucene  Developed by Shay Banon  Latest Version – 1.2  Rich support for Perl, Java, Javascript, Ruby, Node and a lot more clients adaptTo() 2014 5
  6. 6. What & Why??  Document Oriented and Schema free  Support for multi-tenancy  Support for dynamic schema update  High Performance  Just like JCR  Support for complex(nested) documents that can go to any level adaptTo() 2014 6
  7. 7. ElasticSearch Server View adaptTo() 2014 7
  8. 8. Index Creation adaptTo() 2014 8
  9. 9. Fail Safe adaptTo() 2014 9
  10. 10. Analyzing Data adaptTo() 2014 10
  11. 11. How to Index??  First step is to identify the relevant data  Every novel is a mystery novel.  Strangely I have not read any. adaptTo() 2014 11
  12. 12. Bad Indexing  Every novel is a mystery novel.  Strangely I have not read any. adaptTo() 2014 12
  13. 13. Smart Indexing!! adaptTo() 2014 13
  14. 14. Integrating with AEM adaptTo() 2014 14
  15. 15. What All is Needed??  ElasticSearch Server  CQ instance.. :)  Front end for browsing and interacting with an Elastic Search cluster. (Optional) http://mobz.github.io/elasticsearch-head/ Thats it... adaptTo() 2014 15
  16. 16. ElasticSearch dependency  Available in Maven repository <dependency> <groupId>org.elasticsearch</groupId> <artifactId>elasticsearch</artifactId> <version>1.2.0</version> </dependency> adaptTo() 2014 16
  17. 17. Approaches Considered adaptTo() 2014 17
  18. 18. Push & Pull Indexing  Push Indexing  CQ Server pushes data to Elastic Server whenever needed  Pull Indexing  ElasticSearch Server pulls data at regular intervals and indexes it adaptTo() 2014 18
  19. 19. Push Indexing.. Using Replication Agent adaptTo() 2014 19
  20. 20. Push Indexing... Using Replication Agent  Create Serialization Type and setup a replication agent. @Component(label = "Elastic Replication Content Builder", description = "This servlet replicates data to Elastic", immediate = true, enabled = true, metatype = true) @Service(ContentBuilder.class) class ElasticReplicationContentBuilderImpl implements ContentBuilder{ //Override create method } adaptTo() 2014 20
  21. 21. Push Indexing... Using Replication Agent Pros:  Data can be pushed as and when needed. adaptTo() 2014 21
  22. 22. Pull Indexing adaptTo() 2014 22
  23. 23. Features Integrated adaptTo() 2014 23
  24. 24. Features Integrated  Basic Aggregation  Tag based faceting  Free Text Search  Finding all pages in order of relevancy based on some text adaptTo() 2014 24
  25. 25. Facet adaptTo() 2014 25
  26. 26. DEMO adaptTo() 2014 26
  27. 27. More Cool Features/Extension Points... adaptTo() 2014 27
  28. 28. Geo Facet Lets say we need to find all restaurants that are within 1 mile adaptTo() 2014 28
  29. 29. Advanced Aggregation aggregations: { group_by_state: { buckets: [ { key: wv doc_count: 1 average_age: { value: 22 } } { key: al doc_count: 2 average_age: { value: 22 } } ] …............... Group all the employees of an MNC by project location and find average age of each group. adaptTo() 2014 29
  30. 30. Percolator – Search.... Reversed..... Tag all mails from Finance as important adaptTo() 2014 30
  31. 31. Ease of Clustering adaptTo() 2014 31
  32. 32. DEMO adaptTo() 2014 32
  33. 33. Appendix adaptTo() 2014 33
  34. 34. Appendix  http://www.elasticsearch.com/  http://www.elasticsearch.org/guide/  https://forums.adobe.com  Google :) adaptTo() 2014 34
  35. 35. Where is the code?? ● https://github.com/viveksachdeva /elasticsearch-cq.git adaptTo() 2014 35

×