http://marklogic.com/xdmp/privileges/admin-module-read
xquery version "1.0-ml"; import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; let $config := admin:get-configuration() return admin:database-get-range-element-indexes($config, xdmp:database("Documents") ) => The xml for any element range indexes in the "Documents" database, for example: <range-element-index xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://marklogic.com/xdmp/database"> <scalar-type>date</scalar-type> <collation/> <namespace-uri>mynamespace</namespace-uri> <localname>myelementname</localname> <range-value-positions>false</range-value-positions> </range-element-index>
xdmp:host()
(: This query restarts all hosts in the cluster. Note that it will restart the host in which the query is run, too. :) xquery version "1.0-ml"; import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; declare namespace host="http://marklogic.com/xdmp/status/host"; let $hostids := for $id in xdmp:host-status(xdmp:host()) /host:hosts//host:host/host:host-id return fn:data($id) return admin:restart-hosts($hostids)
admin:save-configuration-without-restart
http://marklogic.com/xdmp/privileges/admin-module-write
xquery version "1.0-ml"; import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; let $config := admin:get-configuration() let $spec := admin:forest-set-enabled($config, xdmp:forest("myForest"), fn:true() ) return admin:save-configuration($spec)
admin:save-configuration
xquery version "1.0-ml"; import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; let $config := admin:get-configuration() let $spec := admin:forest-set-enabled($config, xdmp:forest("myForest"), fn:true() ) return admin:save-configuration-without-restart($spec)