2. Whatiselasticsearch?
ElasticSearch is a text-search software created by Shay Banon
(An Israeli guy!).
Under the hood it uses Lucene for it’s fest and intelligent
text abilities.
5. Keyfeatures
Elasticsearch has a lot to offer, here’s just some of the
stuff:
● RESTful API for querying and inserting data
● Massive aggregations abilities
● Custom and pre-made “analyzers” / ”tokenizers”
● It’s easy to scale and cluster
● “Discovery” and “Transport”
● It uses “Sharding” and “Voting” for better performance
6. architecture
Only masters get to “Vote” (and hold data).
Data nodes are just keeping your data safe.
Load balancers are nodes that holds no data and don’t get to
vote.
So… How many “Masters” do I need?
OUR PORTS:
9200-9299 for HTTP Access
9300-9400 for Discovery
& Transport Protocol
9. FromIndexestodocuments
Indexes are like databases, each index holds multiple types
(tables) and each type define the documents in it (records).
A document is the JSON implementation of each entity, and has
many fields with different attributes.
13. Installing
● Java 7 is strongly preferred over Java 6. Either Oracle
or OpenJDK are acceptable.
● Download and Install
● Run curl -X GET http://localhost:9200 (Or browse with Chrome)
● Add this collection to your Postman
14.
15. Createindexes
Create a new index for “posts”:
curl -XPUT 'localhost:9200/my_index’
{
"acknowledged" : true
}
Try to create it again and it throws exception.
16. Indexes“metadata”
From now on, we call it “Mapping” (oohhh… fancy!)
Each index has one or more mapping types, which are used to divide the documents in an
index into logical groups. User documents might be stored in a user type, and blog posts
in a blogpost type.
So Let’s create an Index with Mapping (postman)
17. Workingwithdocuments
Now open your postman and:
1.Create your first tweet
2.Create a formatted tweet
3.Update your tweet
4.Request a specific version
5.Delete your tweet
6.Delete your Index
18. Querying
Download and run some test data
To query Elasticsearch we use QueryDSL, and we send the query JSON to the
server via POST method.
QueryDSL is consisting of two types of clauses:
1. Leaf query clauses: looks for a particular value in a particular field
(Match/Term/Range)
2. Compound query clauses: Compound query clauses wrap other leaf or compound
queries
33. Advancedtopics
● Heap Sizing - DevOps Must
● Elasticsearch and NginX
● Transport Protocol
● Elasticsearch Head
● Plugins and Analyzers
● Aggregations Docs - Dev & PM Must
● Bulk API - Dev Must