To understand how Elasticsearch works, it's necessary that we learn about the architecture of it.
To understand how index, types, documents, and fields work together, let's refer to the following figure:
As seen in the preceding figure, an index contains one or multiple types. A type can be thought of as a table in a relational database. A type has one or more documents. There are one or more fields in the document. Fields are key value pairs.
A cluster has one or more nodes. Clusters are identified by their names. By default, elasticsearch
is the name of the cluster. In case you have to set up multiple Elasticsearch instances, in the same network, you should keep different names or else all nodes will join the same cluster. Similar to clusters, a node also has a name. We can assign it a name and a cluster name to join. In case we don't provide a cluster name to join, then nodes will automatically search and join the cluster with the name elasticsearch
.
If we...