This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare namespace meters = "http://marklogic.com/manage/meters"; | |
declare variable $DATABASE-NAME as xs:string := "Documents"; | |
declare variable $FILENAME as xs:string := "/tmp/fragment-report.csv"; | |
declare variable $QUERY := cts:search(doc(), | |
cts:and-query(( | |
cts:element-query(fn:QName("http://marklogic.com/manage/meters","database-statuses"), cts:and-query(()) ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare namespace db = "http://marklogic.com/xdmp/database"; | |
declare namespace gr = "http://marklogic.com/xdmp/group"; | |
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; | |
declare variable $SUPPORT-DUMP-FILEPATH as xs:string := 'E:\support-request-go\support-request-go.txt'; | |
declare variable $support as document-node()* := xdmp:document-get( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare namespace db = "http://marklogic.com/xdmp/database"; | |
declare namespace gr = "http://marklogic.com/xdmp/group"; | |
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; | |
declare variable $SUPPORT-DUMP-FILEPATH as xs:string := 'E:\support-request-go\support-request-go.txt'; | |
declare variable $support as document-node()* := xdmp:document-get( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare namespace db = "http://marklogic.com/xdmp/database"; | |
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; | |
declare variable $SUPPORT-DUMP-FILEPATH as xs:string := 'E:\support-request-go\support-request-go.txt'; | |
declare variable $support as document-node()* := xdmp:document-get( | |
$SUPPORT-DUMP-FILEPATH, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
import module namespace view = "http://marklogic.com/xdmp/view" | |
at "/MarkLogic/views.xqy"; | |
declare option xdmp:mapping 'false'; | |
let $_schema_remove := | |
let $current := try { view:schema-get ('main') } catch ($e) { () } | |
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for $uri in cts:uris ( (), ("frequency-order", "document") ) | |
where cts:frequency ($uri) gt 1 | |
return $uri |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you've done this right you should see this in /var/opt/MarkLogic | |
# lrwxrwxrwx 1 root root 16 Sep 10 03:54 Logs -> /space/ErrorLogs | |
sudo ln -s /space/ErrorLogs /var/opt/MarkLogic/Logs | |
mkdir /space/ErrorLogs | |
chown -R daemon:daemon /space/ErrorLogs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.BufferedWriter; | |
import java.io.IOException; | |
import java.net.URLEncoder; | |
import java.nio.charset.Charset; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import java.nio.file.StandardOpenOption; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare namespace prop="http://marklogic.com/xdmp/property"; | |
declare variable $doc-count as xs:int := 10; | |
for $item in (1 to $doc-count) | |
let $eval := "xquery version '1.0-ml'; | |
declare variable $count as xs:string external; | |
xdmp:document-insert(fn:concat('/test/', $count, '.xml'), element root{ $count })" | |
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
for $doc in doc() | |
let $sort-key := xs:dateTime(xdmp:document-properties(fn:base-uri($doc))/prop:properties/prop:last-modified) | |
order by $sort-key | |
return | |
fn:concat("Doc: ", fn:base-uri($doc), " was inserted at: ", $sort-key) |