Introduction
Elasticsearch has become a common component in big data architectures because it provides several features:
It allows searching on massive amount of data in a very fast way
For common aggregation operations, it provides real-time analytics on big data
It's more easy to use an Elasticsearch aggregation than a spark one
If you need to move on to a fast data solution, starting from a subset of documents after a query is faster than doing a full rescan of all your data
The most common big data software used for processing data is now Apache Spark (http://spark.apache.org/) that is considered the evolution of the obsolete Hadoop MapReduce moving the processing from disk to memory.
In this chapter, we will see how to integrate Elasticsearch in Spark both for write and read data. In the end, we will see how to use Apache Pig to write data in Elasticsearch in a simple way.