Elasticsearch is search engine server where you can index your records and make a very effect search and ranking, when use millions of records. Elastic search use as base, a java project called Apache Lucene, elastic team build a REST api where you can use all the features of Lucene by making simple http request with data in json format.
So the logic is simple, initially you have to create a index on elastic server and after that you have to store data that you want be searchable, for example in a eshop you could store the title and description of all products. Then make an effective search buy using specific characteristics of lucene, like wildcard search, fuzzy search, range Search and others.
Elastic search is also a part of the ELK stack, where means elasticsearch, logstash and kibana. Logstash is tool that is used to take logs and data from different sources and data formats and transporting them to elastic search or anyother destination. Kibana is a visualization tool that you can create graphs and dashboards. In the near future ELK stack will be major player in analytics platforms.