This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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()*) { | |
( | |
" ******************* ", |
This file contains hidden or 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 hidden or 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 hidden or 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( |