Loading TOC...

MarkLogic Server 11.0 Product Documentation
flexrep:document-reset

flexrep:document-reset(
   $uri as xs:string,
   $domain-id as xs:unsignedLong,
   [$target-ids as xs:unsignedLong*]
) as empty-sequence()

Summary

This function resets the URI status for all replication targets. A reset involves retaining any record of last success, clearing any failure status, and setting the time for the next replication attempt to the current time. The status is reset for the specified $target-ids . If no $target-ids parameter is specified, then the URI status for all replication targets is reset.

Resetting the URI status for a target is useful if the document has errored out due to too many failures, or if you want to replicate the document again.

Parameters
uri The URI to be assigned the new status.
domain-id The ID of the replicated domain.
target-ids The ID of the replication target.

Example

  xquery version "1.0-ml"; 

  import module namespace flexrep = "http://marklogic.com/xdmp/flexible-replication" 
      at "/MarkLogic/flexrep.xqy";

  (: Obtain the domain ID from the database used by the Master to enable CPF. :)
  let $domain := xdmp:eval(
        'xquery version "1.0-ml";
         import module namespace dom = "http://marklogic.com/cpf/domains" 
            at "/MarkLogic/cpf/domains.xqy";
         fn:data(dom:get( "Replicated Content" )//dom:domain-id)',
         (),
         <options xmlns="xdmp:eval">
            <database>{xdmp:database("MyTriggers")}</database>
         </options>)

  let $cfg := flexrep:configuration-get($domain, fn:true())
  let $target-id := flexrep:configuration-target-get-id($cfg, "Replica")

  return
      flexrep:document-reset("http://localhost:8011/", $domain, $target-id)

  (: Resets the URI status for the "Replica" target. :)
     

Required Privileges

http://marklogic.com/xdmp/privileges/flexrep-user

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