MarkLogic Java Client API

The MarkLogic Java Client API is an open-source library that allows developers to quickly, easily, and reliably access MarkLogic from their Java applications.

  DatabaseClient client = Configuration.exampleClient();

  // Build a structured query. Here we're doing a pretty broad collection query 
  StructuredQueryBuilder builder = client.newQueryManager()
  QueryDefinition query = builder.and(builder.collection("sample data"));

  DocumentPage page = client.newDocumentManager().search(query, 1);

  // Iterate through the results, which include the raw documents,
  // available with a ReadHandle.
  for (DocumentRecord doc : page) {
    System.out.println(doc.getContent(new JacksonParserHandle()));

Faster development and less custom code with out-of-the-box data management, search, and alerting

Pure Java query builder and conveniences for POJOs, JSON, XML, and binary I/O

Built-in extensibility for moving performance-critical code to the database

Move faster to production with proven reliability at scale

Always open source on GitHub

Next Steps


  • Cannot get MarkLogic 7.0-5.1 to create a range path index on json document. Have tried reindexing but using xquery empty sequence is returned when calling cts:value-ranges. Is range path index on json documents in MarkLogic 7.0 supported ?