tieredstorage:forest-combine( $forest-ids as xs:unsignedLong*, $forest-name as xs:string, $host-id as xs:unsignedLong, [$data-directory as xs:string?], [$large-data-directory as xs:string?], [$fast-data-directory as xs:string?], [$options as xs:string*] ) as empty-sequence()
This function combines data in multiple forests into one new forest. If no data directory is specified, the default data directory is used. The source forests are required to be either all in "open" or "open-replica" state or all in "sync replicating" state. If a forest's state changes during the combine operation, an error may be thrown. If all source forests are in "open" or "open replica" state and are all attached to a database, the combined forest will be attached to the database and the source forests (or their masters) detached to the database. For details, see Combining Forests in the Administrator's Guide.
snapshotoption when combining forests with overrides. Otherwise an
TS-FORESTHASOVERRIDEexception will be thrown.
xquery version "1.0-ml"; import module namespace ts="" at "/MarkLogic/tieredstorage.xqy"; ts:forest-combine( (xdmp:forest("Forest1"), xdmp:forest("Forest2")), "ForestCombined", xdmp:host(), "/tmp/test") (: Combines Forest1 and Forest2 into a single forest, named ForestCombined, in the /tmp/test data directory. :)
