Elasticsearch is a near real time search platform what this means is there is a slight latency (normally one second) from the time you index a document until the time it becomes searchable.
The way it does searching is very similar to such as searching a particular term or a word in the INDEX section of a book. Every book has index page where the list of most important and common terms are mentioned with there page numbers.
History: Elasticsearch is built no top of a search engine named as LUCENE (lucene.apache.org) which was released in 1998 as a part of apache project. The underlying data structure used in that software is INVERTED INDEX which basically maps words or numbers to the actual document locations of where those words occur.
The documentation of Elasticsearch also provides a good overview of inverted index. https://www.elastic.co/guide/en/elasticsearch/guide/current/inverted-index.html
How Elasticsearch related to database:
So a Column in a DB can be considered as a Field in Elastic search and similarly a Row in DB can be considered as a Document.
So as in the above screenshot. Vehicles is the index(Database), Cars, Motorcycle, Trucks are the Type (Tables).
The different cars, motorcycles are the different documents(Rows).