Loading TOC...

xdmp:merge

xdmp:merge(
   [$options as (element()|map:map)?]
) as empty-sequence()

Summary

Starts merging the forests of the database, subject to specified options. For any options that are not specified, their default values are used, not the values that are in the configuration files.

Parameters
options The options node for this merge. The default value is () . The node for the xdmp:merge options must be in the xdmp:merge namespace.

The xdmp:merge options include:

<merge-timestamp>

Fragments with a timestamp of this or newer are not garbage collected during this merge. A negative value means the timestamp is relative to the time the merge starts, at ten million ticks per second. For example, -6000000000 means ten minutes before the merge. The default is 0, which means not specifying a timestamp.

<merge-max-size>

The maximum allowable size, in megabytes, of a resultant stand. The default value is 32768 (32G). A value of 0 means there is no limit. It is possible for a stand larger than the merge-max-size to merge if the stand has enough deleted fragments to trigger the merge min ratio; in this case, MarkLogic will do a single-stand merge, merging out the deleted fragments (even if the resulting stand is larger than the merge-max-size value specified).

<merge-priority>

The CPU scheduler priority for the merge ("normal" or "lower").

<single-stand>

If any forests in the database have a single stand and this parameter is false, do not merge them. The default is true.

<forests>

Specifies the IDs of the forests in which to perform merges. Each forest ID is in the <forest> child element and is of type xs:unsignedLong . The default is to merge all of the forests in the database.

Required Privileges

http://marklogic.com/xdmp/privileges/xdmp-merge

Example

  xdmp:merge(<options xmlns="xdmp:merge">
               <merge-max-size>500</merge-max-size>
               <merge-timestamp>8273</merge-timestamp>
               <single-stand>false</single-stand>
               <forests>
                 <forest>{xdmp:forest("my-forest")}</forest>
                 <forest>{xdmp:forest("my-other-forest")}</forest>
               </forests>
             </options>)
   => ()

   Performs a merge on my-forest and my-other-forest.  If a stand
   created by this merge would be greater than 500 megabytes, the merge
   will be limited and not all stands will be merged (as many as can be
   merged under 500 MB will be merged).  If my-forest or my-other-forest
   have only one stand, they will not be merged.  Any fragments with
   timestamp 8273 or newer will not be garbage collected.

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.