The document provides an overview of Elasticsearch, including its terminology, architecture, and functionalities such as indexing, querying, and deleting documents. Key concepts discussed include indices, types, and documents, along with their comparisons to relational databases. Additionally, it outlines installation procedures and configuration settings for setting up and running an Elasticsearch server.
Terminology
▪ Index
– Ismeans of storing different types of data.
– Can span across one primary shard or multiple shards.
– Identified by metadata field _index
– An Index can contain multiple types
5.
Terminology
▪ Type
– Atype is a convenient way to store a specific type of data within an
index
– Identified by metadata field _type
6.
Terminology
▪ Document
– Adocument is JSON object (set of
‘key-value’ pairs aka fields)
▪ _type
▪ _id
▪ _source
7.
Terminology
▪ Field
– Key
▪type (data type)
▪ Format
– Value
▪ Can hold scalar data (int, string values)
or Nested structures like array or
object
Search
Internode Communication
• Sendsparallel Queries to all nodes
• Merges the full response
• Response returned to the user
N
N
N
Cluster
P2P Architecture
Default Port 9300
Search
Doc # Contents
1Fantastic Beasts and Where to FindThem
2 Beasts of the SouthernWild
3 The Wild Life
4 Life of a Pi
Term Frequency Documents
and 2 1
beasts 2 1,2
fantastic 1 1
find 1 1
life 2 3,4
of 2 2,4
pi 1 4
southern 1 2
the 2 2,3
them 1 1
to 1 1
where 1 1
wild 2 2,3
Inverted Index
Querying
Syntax Example
Search
GET /{index}/_searchGET demo/_search
Search by type & id
GET /{index}/{type}/{id} GET demo/reservation/1
Search by property
GET /{index}/_search?q={propName}=“value" GET /demo/_search?q=guestname="Mr.J"
Free search across index
GET /{index}/_search?q=‘value' GET demo/reservation/1