User-Defined Function API  6.0-6
 All Classes Functions Enumerations Enumerator
User-Defined Function API Documentation

Use this API to create user-defined functions (UDFs) callable from XQuery, Java, and RESTful MarkLogic Server applications. The API includes the following UDF interfaces:

  • AggregateUDF: Create a function to analyze range index values.

To deploy your UDF, package it as a MarkLogic Server native plugin library and install it using plugin:install-from-zip. When you install your plugin to one host in a MarkLogic Server cluster, it is automatically deployed to all hosts in the cluster.

NOTE: UDFs run in the same process space as the MarkLogic Server core. Errors and incompatibilities in your plugin can crash MarkLogic Server.

For more information on creating native plugins and user-defined functions, see "In-Database MapReduce Functions" in the Application Developer's Guide.

For a complete example of a native plugin that implements the AggregateUDF interface, see marklogic_dir/Samples/NativePlugin.