Elastic search adaptto2014
-
Upload
vivek-sachdeva -
Category
Software
-
view
1.112 -
download
3
description
Transcript of Elastic search adaptto2014
![Page 1: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/1.jpg)
APACHE SLING & FRIENDS TECH MEETUPBERLIN, 22-24 SEPTEMBER 2014
Integrating ElasticSearch with AEMVivek Sachdeva, Intelligrape Software @vivek_sach
![Page 2: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/2.jpg)
Agenda
adaptTo() 2014 2
Introduction to ElasticSearch Analyzing Data Integration with AEM Approaches Considered Features Integrated Extension Points
![Page 3: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/3.jpg)
About Me :)
adaptTo() 2014 3
Started career as Java Developer in 2010 Worked on Groovy and Grails Currently working as AEM(plus Groovy) Developer Intelligrape Software [email protected] in.linkedin.com/pub/vivek-sachdeva/20/192/934/
![Page 4: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/4.jpg)
adaptTo() 2014 4
Elastic Search – An Introduction
![Page 5: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/5.jpg)
What & Why??
adaptTo() 2014 5
ElasticSearch is a distributed, RESTful, free/opensource 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
![Page 6: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/6.jpg)
What & Why??
adaptTo() 2014 6
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
![Page 7: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/7.jpg)
adaptTo() 2014 7
ElasticSearch Server View
![Page 8: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/8.jpg)
Index Creation
adaptTo() 2014 8
![Page 9: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/9.jpg)
Fail Safe
adaptTo() 2014 9
![Page 10: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/10.jpg)
adaptTo() 2014 10
Analyzing Data
![Page 11: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/11.jpg)
How to Index??
adaptTo() 2014 11
First step is to identify the relevant data
Every novel is a mystery novel. Strangely I have not read any.
![Page 12: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/12.jpg)
Bad Indexing
adaptTo() 2014 12
Every novel is a
mystery novel. Strangely I have not
read any.
![Page 13: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/13.jpg)
Smart Indexing!!
adaptTo() 2014 13
![Page 14: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/14.jpg)
adaptTo() 2014 14
Integrating with AEM
![Page 15: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/15.jpg)
What All is Needed??
adaptTo() 2014 15
ElasticSearch Server CQ instance.. :) Front end for browsing and interacting with an Elastic
Search cluster. (Optional)http://mobz.github.io/elasticsearch-head/
Thats it...
![Page 16: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/16.jpg)
ElasticSearch dependency
adaptTo() 2014 16
Available in Maven repository
<dependency>
<groupId>org.elasticsearch</groupId> <artifactId>elasticsearch</artifactId>
<version>1.2.0</version></dependency>
![Page 17: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/17.jpg)
adaptTo() 2014 17
Approaches Considered
![Page 18: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/18.jpg)
Push & Pull Indexing
adaptTo() 2014 18
Push Indexing CQ Server pushes data to Elastic Server
whenever needed
Pull Indexing ElasticSearch Server pulls data at regular intervals
and indexes it
![Page 19: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/19.jpg)
Push Indexing.. Using Replication Agent
adaptTo() 2014 19
![Page 20: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/20.jpg)
Push Indexing... Using Replication Agent
adaptTo() 2014 20
Create Serialization Type and setup a replicationagent.
@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
}
![Page 21: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/21.jpg)
Push Indexing... Using Replication Agent
adaptTo() 2014 21
Pros: Data can be pushed as and
when needed.
![Page 22: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/22.jpg)
Pull Indexing
adaptTo() 2014 22
![Page 23: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/23.jpg)
adaptTo() 2014 23
Features Integrated
![Page 24: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/24.jpg)
Features Integrated
adaptTo() 2014 24
Basic Aggregation Tag based faceting
Free Text Search Finding all pages in order of relevancy based on
some text
![Page 25: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/25.jpg)
Facet
adaptTo() 2014 25
![Page 26: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/26.jpg)
adaptTo() 2014 26
DEMO
![Page 27: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/27.jpg)
adaptTo() 2014 27
More Cool Features/Extension Points...
![Page 28: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/28.jpg)
Geo Facet
adaptTo() 2014 28
Lets say we need to
find all restaurants that are within 1
mile
![Page 29: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/29.jpg)
Advanced Aggregation
adaptTo() 2014 29
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.
![Page 30: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/30.jpg)
Percolator – Search.... Reversed.....
adaptTo() 2014 30
Tag all mails from Finance
as important
![Page 31: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/31.jpg)
Ease of Clustering
adaptTo() 2014 31
![Page 32: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/32.jpg)
adaptTo() 2014 32
DEMO
![Page 33: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/33.jpg)
adaptTo() 2014 33
Appendix
![Page 34: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/34.jpg)
Appendix
adaptTo() 2014 34
http://www.elasticsearch.com/ http://www.elasticsearch.org/guide/ https://forums.adobe.com Google :)
![Page 35: Elastic search adaptto2014](https://reader034.fdocuments.in/reader034/viewer/2022042518/54743929b4af9fae0a8b5625/html5/thumbnails/35.jpg)
Where is the code??
adaptTo() 2014 35
● https://github.com/viveksachdeva
/elasticsearch-cq.git