- copy stuff from example build.gradle to your own build.gradle
- define mlcpVersion in your gradle.properties (for example:
10.0.8.2
) - Download MLCP binaries, and extract into a folder names
mlcp/
in your project - Remove bin/*.sh, bin/*.bat, lib/*.jar, lib/*.txt, src/*, docs/*
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
def resolveTokens(str) { | |
if (str != null) { | |
Map<String, String> customTokens = mlAppConfig.getCustomTokens(); | |
if (customTokens != null) { | |
for (String key : customTokens.keySet()) { | |
if (key != null) { | |
String value = customTokens.get(key); | |
if (value != null) { | |
str = str.replace(key, value); | |
} |
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"; | |
module namespace tl = "http://marklogic.com/task-lib"; | |
import module namespace tb="ns://blakeley.com/taskbot" at "/lib/taskbot/taskbot.xqm"; | |
declare namespace eval="xdmp:eval" ; | |
declare option xdmp:mapping "false"; |
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
# hide secrets | |
secrets.properties |
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
{ | |
"Docker": { | |
"Name": "{{ .Docker.Name }}", | |
"NumContainers": {{ .Docker.NumContainers }}, | |
"NumImages": {{ .Docker.NumImages }}, | |
"Version": "{{ .Docker.Version }}", | |
"ApiVersion": "{{ .Docker.ApiVersion }}", | |
"GoVersion": "{{ .Docker.GoVersion }}", | |
"OperatingSystem": "{{ .Docker.OperatingSystem }}", | |
"Architecture": "{{ .Docker.Architecture }}", |
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 option xdmp:mapping "false"; | |
declare function local:matchRegion0($region as xs:string, $country as xs:string?) | |
as xs:boolean | |
{ | |
let $in-country := '/country[name-variants/variant = $country]/regions/region/name-variants/variant' | |
let $anywhere := '/country/regions/region/name-variants/variant' |
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
'use strict'; | |
// Fluent interface functions | |
function document(root) { | |
return function(b) { | |
return (b || new NodeBuilder()).addDocument(root); | |
} | |
} |
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:draw-one($remaining-map, $member) { | |
let $household-name := name($member/..) | |
let $household-map := map:get($remaining-map, $household-name) | |
let $household-count := count(map:keys($household-map)) | |
let $household-key := $household-name || "/" || head(map:keys($household-map)) | |
let $remaining-members := | |
for $h-name in map:keys($remaining-map) |
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"; | |
let $term := "werld" | |
let $start-char := substring($term,1,1) | |
let $limit := 10 | |
let $threshold := 100 | |
return ( | |
for $candidate in cts:field-words("meta-content",$start-char) | |
let $distance := | |
if (starts-with($candidate, $start-char) and string-length($candidate) le 64) then |
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"; | |
module namespace ext = "http://marklogic.com/rest-api/resource/analyze-data"; | |
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; | |
declare namespace roxy = "http://marklogic.com/roxy"; | |
declare namespace xs = "http://www.w3.org/2001/XMLSchema"; | |
declare namespace db = "http://marklogic.com/xdmp/database"; |
NewerOlder