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 sec="http://marklogic.com/xdmp/security" at | |
"/MarkLogic/security.xqy"; | |
(xdmp:set-response-content-type("text/html; charset=utf-8"), | |
'<!DOCTYPE html>', | |
element html { | |
element head { | |
element title {"Role / Privilege mappings for security database version: ", xs:string(//sec:version)} |
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
aws ec2 run-instances --image-id ami-XXXXXXX --instance-type m3.medium --security-groups XXXXX --key-name XXXXXX --monitoring Enabled=true --iam-instance-profile Name=MarkLogic --block-device-mappings "[{\"DeviceName\": \"/dev/sdf\",\"Ebs\":{\"VolumeSize\":10,\"VolumeType\":\"gp2\" }}]" |
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"; | |
(: | |
: Example for locally loading a MarkLogic support dump as a sequence | |
: of document-node() elements for reporting and analysis | |
:) | |
declare variable $path as xs:string := 'C:\Users\ableasdale\Desktop\dump.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 variable $path-segment := "E:\plan-docs\"; | |
declare variable $query := xdmp:plan(cts:search(doc(), cts:word-query("test"))); | |
declare variable $query2 := xdmp:plan(cts:search(doc(), cts:word-query(("test", "time", "language", "gas", "police", "politics")))); | |
declare function local:get-distinct-term-keys($query) as xs:unsignedLong* { | |
distinct-values($query//xs:unsignedLong(*:key)) | |
}; |
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 function local:http-get-proxy($proxy as xs:string, $uri as xs:string) { | |
let $host := tokenize($uri,'/')[3] | |
let $proxyuri := resolve-uri(substring-after($uri, $host), $proxy) | |
return | |
xdmp:http-get($proxyuri, | |
<options xmlns="xdmp:http"> | |
<headers> |
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"; | |
(: | |
: Get the Forest in-memory usage | |
:) | |
declare default element namespace "http://marklogic.com/xdmp/status/forest"; | |
declare variable $path as xs:string := 'C:\Users\Public\Documents\ML_status_only_support_dump_20110118'; | |
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"; | |
(: | |
: Example: calculate the average size of a forest | |
:) | |
declare default element namespace "http://marklogic.com/xdmp/status/forest"; | |
declare variable $path as xs:string := 'C:\Users\Public\Documents\ML_status_only_support_dump_20110118'; |
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"; | |
(: | |
: Example: calculate the on-disk size of each forest | |
:) | |
declare default element namespace "http://marklogic.com/xdmp/status/forest"; | |
declare variable $path as xs:string := 'E:\support_qa_60.dmp'; | |
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 variable $filename := xdmp:get-request-field("file"); | |
declare variable $dir-base as xs:string := "C:\Program Files\MarkLogic\Config\"; | |
declare function local:bootstrap-shim($title, $content){ | |
xdmp:set-response-content-type("text/html; charset=utf-8"), | |
("<!DOCTYPE html>", | |
<html lang="en"> | |
<head> |
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 admin = "http://marklogic.com/xdmp/admin"; | |
declare variable $strings := ( "size", "ratio", "threshold", "max", "min", "limit", "rate", "throttle" ); | |
declare variable $dir-base as xs:string := "C:\Program Files\MarkLogic\Config\"; | |
declare function local:display($it as item()*) { | |
( | |
" ******************* ", |