MarkLogic is an enterprise-class NoSQL database that includes a REST enabled full-text search feature.. You can use it to store, search, and query massive amounts of data, represented as documents having various formats. MarkLogic exposes its core functionality through a Java API, allowing you to write applications in pure Java.

The Java API makes use of a powerful underlying REST API for communicating with MarkLogic Server. This tutorial will walk you through a series of HOWTOs for working with MarkLogic exclusively through its Java API, using a series of sample apps that illustrate the use cases.

Setup

Install MarkLogic

Download and install the latest version of MarkLogic. Once you’ve installed and started up MarkLogic, go to the browser-based administrative interface (at http://localhost:8001/), where you’ll be walked through the process of getting a Developer License, as well as setting up an admin user. (This tutorial assumes you’ll be running MarkLogic on your local machine; if that’s not the case, just substitute your server name whenever you see “localhost” in this tutorial.)

If you need more detailed instructions on installing and running MarkLogic, see Installing MarkLogic Server.

Set up the tutorial project

Next, download the tutorial project: java-api-tutorial-start.zip. Unzip the file into a directory of your choice on your machine.

The tutorial files have been packaged as an ml-gradle project and can be opened in any integrated development environment (IDE). More information about the gradle tasks and project layout is available in the ml-gradle github wiki.

Let’s take a quick glance at the current project structure: