admin:range-assignment-policy( $partition-key as cts:reference, $lower-bound-included as xs:boolean ) as element(db:assignment-policy)
This function returns an element that represents the range assignment policy.
Use the
admin:database-set-assignment-policy
function to set the assignment policy.
xquery version "1.0-ml"; import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; (: An element range index is already configured for element "foo" on database "myDatabase" :) let $config := admin:get-configuration() let $dbid := admin:database-get-id($config, "myDatabase") (: range assignment policy doesn't work with fast locking; use "strict" or no locking instead :) let $config := admin:database-set-locking($config, $dbid, "strict") let $ref := cts:element-reference(xs:QName("foo")) let $range-policy := admin:range-assignment-policy($ref, fn:true()) let $config := admin:database-set-assignment-policy($config, $dbid, $range-policy) return admin:save-configuration($config)