tieredstorage.rangePartitionCreate( database-id as (Number|String), partition-name as String, lower as xs.anyAtomicType?, upper as xs.anyAtomicType?, forests-per-host as Number, host-ids as (Number|String)[], [data-directory as String?], [large-data-directory as String?], [fast-data-directory as String?], [options as String[]] ) as null
This function creates forests on the specified hosts and forms a range partition with the specified partition range. All of the forests will share the partition name as their prefix, as well as the range policy settings. The names of the created forests will either be in the form of partition- name-[fixed-digit-number] or partition-name-[fixed-digit-number]-[M,Rn], if local disk failover is configured. For details, see Creating Range Partitions in the Administrator's Guide.
// Creates a range partition, named 2017, on the Documents database with a date range of 1/1/2017 // through 1/31/2017. The partition consists of four master forests and four replica forests // distributed across two hosts and configured for local disk failover. const ts = require('/MarkLogic/tieredstorage'); ts.rangePartitionCreate( xdmp.database('Documents'), '2017', xs.date('2017-01-01'), xs.date('2017-12-31'), 2, [xdmp.host('host-1.marklogic.com'), xdmp.host('host-2.marklogic.com')], '/forest', null, null, ['failover=local', 'replicas=1']);
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.