ElasticSearch interview questions

ElasticSearch Interview questions

Elasticsearch is a real-time distributed, RESTful search and analytics engine that built on the top of Apache Lucene which is a full-text search engine. you can see Elasticsearch as a distributed store and that features Real-time Analytics. It is document oriented that stores objects as document and make then indexable so the content of documents is searchable.

Few Known Fact about ElasticSearch

  • Built on Top of Lucene (A full-text search engine by Apache )
  • Document-Oriented (Stores data structured JSON documents)
  • Full-Text Search (Supports Full-text search indexing which giving faster result retrieval)
  • Schema-Free (Uses NoSQL)
  • Restful API (Support Restful APIs for storage and retrieval of records)
  • Supports Autocompletion & Instant Search

Following are the list of Top 25 ElasticSearch Interview questions with their answers

#1 What is a type of Elastic search?

A type in Elasticsearch is a logical category of the index whose semantics are completely up to the user.

#2 Can Elasticsearch replace database?

Yes, Elasticsearch can be used as a replacement for a database as the Elasticsearch is very powerful.
It offers features like multitenancy, sharding and Replication, distribution and cloud Realtime get, Refresh, commit, versioning and re-indexing and many more, which make it an apt replacement of a database.

#3 How to start elastic search server?

Run Following command on your terminal to start Elasticsearch server:
cd elasticsearch

curl ‘http://localhost:9200/?pretty’ command is used to check ElasticSearch server is running or not.

#4 How to list all indexes of a Cluster in ES.?

By using GET / _index name/ indices we can get the list of indices present in the cluster.

#5 How to add a Mapping in an Index?

Basically, Elasticsearch will automatically create the mapping according to the data provided by the user in the request body. Its bulk functionality can be used to add more than one JSON object in the index.

Ex: POST website /_bulk

#6 What is an Index?

An index in Elasticsearch is similar to a table in relational databases.The only difference lies in storing the actual values in the relational database, whereas that is optional in Elasticsearch.
An index is capable of storing actual or analyzed values in an index.

#7 What is a current stable version of Elasticsearch?

As on March 2018, the version 6.2.2 is the latest and stable version of Elasticsearch.

#8 What is REPLICAS?

Each shard in elastic search has again two copies of the shard that are called the replicas.
They serve the purpose of fault tolerance and high availability.

#9 How can you retrieve a document by ID in ES.?

To retrieve a document in Elasticsearch, we use the GET verb followed by the _index, _type, _id.
Ex: GET / computer / blog / 123?=pretty

#10 What is a Node?

Each and every instance of Elasticsearch is a node.And, a collection of multiple nodes which can work in harmony form an Elasticsearch cluster.

#11 Can you list some companies that use Elasticsearch?

Some of the companies that use Elasticsearch along with Logstash and Kibana are:
  • Wikipedia
  • Netflix
  • Accenture
  • Stack Overflow
  • Fujitsu
  • Tripwire
  • Medium
  • Swat.io
  • Hip chat

#12 How to add or create an index in Elastic Search Cluster?

By using the command PUT before the index name, creates the index and if you want to add another index then use the command POST before the index name.
Ex: PUT website

An index named computer is created

#13 How to delete an index in Elastic search?

To delete an index in Elasticsearch use the command DELETE /index name.

Ex: DELETE /website

#14 List different types of queries supported by Elasticsearch?

The Queries are divided into two types with multiple queries categorized under them.
  • Full-text queries: Match Query, Match phrase Query, Multi match Query, Match phrase prefix Query, common terms Query, Query string Query, simple Query String Query.
  • Term level queries: term Query, term set Query, terms Query, Range Query, Prefix Query, wildcard Query, regexp Query, fuzzy Query, exists Query, type Query, ids Query.

#15 What are SHARDS?

There are resource limitations like RAM, vCPU etc., for scale out, due to which applications employ multiple instances of Elasticsearch on separate machines.
Data in an index can be partitioned into multiple portions which are managed by a separate node or instance of Elasticsearch.Each such portion is called a Shard.And an Elasticsearch index has 5 shards by default.
Ask a Question