info:load( $dir-path as xs:string, [$policy-name as xs:string?], [$policy-deltas as element(info:options)?], [$database as xs:string] ) as xs:string
[DEPRECATED] This function does a one-time scan of the named directory path (local filesystem only), and attempts to load the files, spawning multiple transactions if necessary. This collector should be considered stateless; although some lightweight state information is passed via an external variable to the executing module, it is not persistent. Transactions are asynchronous, and order of insertions is not guaranteed.
This function returns a ticket URI that can be used to access status information for that ticket.
info:load
are added to a
collection with the URI corresponding to the ticket ID
returned from the function. For example, if info:load
returns /tickets/ticket/123456
, then any documents loaded
have the collection /tickets/ticket/123456
(in
addition to any collections added via the options
node or options delta).
xquery version "1.0-ml"; import module namespace info = "http://marklogic.com/appservices/infostudio" at "/MarkLogic/appservices/infostudio/info.xqy"; info:load("C:\docs\mydocs", (), (), "testDB") (: Loads the contents of the C:\docs\mydocs directory into the testBD database using the default policy. :)
xquery version "1.0-ml"; import module namespace info = "http://marklogic.com/appservices/infostudio" at "/MarkLogic/appservices/infostudio/info.xqy"; let $delta := <options xmlns="http://marklogic.com/appservices/infostudio"> <uri> <literal>http://mydir/</literal> <filename/> <literal>.</literal> <ext/> </uri> </options> return info:load("C:\docs\mydocs", (), $delta, "testDB") (: Loads the contents of the C:\docs\mydocs directory into the testBD database at the URI http://mydir/, using the rest of the options specified by the default policy. For example, C:\docs\mydocs\mydoc.xml will be loaded into the database with the URI http://mydir/mydoc.xml. :)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.