Loading TOC...

xdmp.merge

xdmp.merge(
   [$options as Object?]
) as null

Summary

Starts merging the forests of the database, subject to specified options.

Parameters
$options The options object for this merge. The default value is null .

The xdmp.merge options include:

mergeTimestamp

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.

mergeMaxSize

The maximum allowable size, in megabytes, of a resultant stand. The default value is taken from the database configuration. 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).

mergePriority

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

singleStand

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 of type string. The default is to merge all of the forests in the database.

Required Privileges

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

Example

  xdmp.merge({
               "mergeMaxSize": 500,
               "mergeTimestamp": 8273,
               "singleStand": false,
               "forests": [
                 xdmp.forest("my-forest"),
                 xdmp.forest("my-other-forest")
               ]
             })
   => null

   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.

Comments

  • I am running xdmp.merge({ "mergeMaxSize": 500, "mergeTimestamp": 14307959410102210, "singleStand": false, "forests": [ xdmp.forest("PROD_DB_1") ] }) But it is giving me syntax error [1.0-ml] XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error, unexpected Lbrace_
    • Make sure you've select JavaScript as your query type. I see that error if I run you code with Query Type: XQuery.
      • Thanks David it worked yes I selected XQuery type instead of JavaScript.
Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy