Elasticsearch is a search engine that can be used to search all kind of documents in a near real-time. MongoDB, on the other hand, is a very popular NoSQL database which uses JSON data model for storing your data. A common architecture around these two is using MongoDB for storing your data and Elasticsearch for searching the data. In this tutorial, we will walk you through on how you can import or migrate data from MongoDB to Elasticsearch for your analysis using the Progress DataDirect MongoDB JDBC connector.
Before you go ahead with the tutorial, we assume that you have access/ installed the following.
1. Download the JDBC importer for Elasticsearch from here and extract the contents.
2. Copy the Progress DataDirect MongoDB JDBC connector (mongodb.jar) from C:\Program Files\Progress\DataDirect\JDBC_60\lib to \\path\elasticsearch-jdbc-184.108.40.206\lib folder
3. Now go to the path \\path\elasticsearch-jdbc-220.127.116.11\bin and create a new bat file with following script and save it.
Now that your MongoDB data is in your Elasticsearch node, you can begin searching it. Some examples for your reference.
(These links will work only after you follow the steps above to set up your local Elasticsearch environment.)
Progress DataDirect provides the only SQL connectivity solution that exposes MongoDB data in the way SQL applications expect–as normalized relational tables–and the only solution that supports normalizing all data in your MongoDB database regardless of the depth and complexity of the documents stored. It’s relational connectivity to MongoDB data with no compromises. Try it free for 15 days.