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 $TARGET-DIRECTORY as xs:string := "/"; | |
declare variable $TARGET-DATABASE as xs:string := "YourDatabaseName"; | |
declare variable $BATCH-SIZE as xs:integer := 20000; | |
for $uri in cts:uris("", ("document", "limit="||$BATCH-SIZE), cts:directory-query($TARGET-DIRECTORY)) | |
return | |
xdmp:eval( | |
"declare variable $URI as xs:string external; |
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"; | |
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; | |
declare variable $CONFIG := admin:get-configuration(); | |
admin:forest-get-updates-allowed($CONFIG, admin:forest-get-id($CONFIG, "Documents")) |
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 $URIS as xs:string+ := ("/doc1.xml", "/doc2.xml", "/doc3.xml"); | |
for $uri at $pos in $URIS | |
return xdmp:save("/tmp/" || $pos || ".xml", fn:doc($uri)) |
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"; | |
for $i in cts:uris ( | |
(), | |
("limit=10000"), | |
cts:not-query(cts:collection-query("moved")) | |
) | |
let $document := fn:doc($i) | |
return | |
(xdmp:document-add-collections($i, "moved"), |
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
* LFCS Domains 2015.02 | |
Note - the domains will change somewhat in March 2015. SW RAID | |
with mdadm will be removed | |
** The Command Line | |
*** Editing text files on the CLI | |
Covers the use of the basic text editors nano and gedit as well | |
as the advanced editors _vi_ and _emacs_ | |
- nano | |
simple CLI-based text editor |
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 qry = "http://marklogic.com/cts/query"; | |
cts:uris((),(),cts:and-query(xdmp:plan(/binary())//qry:term-query/qry:key ! cts:term-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"; | |
import module namespace search = "http://marklogic.com/appservices/search" at "/MarkLogic/appservices/search/search.xqy"; | |
xdmp:document-insert("/doc1.xml",text{"101 dalmatians is a fun story about dogs escaping from the hands of Cruella"}), | |
xdmp:document-insert("/doc2.xml",text{"Fun, fun, fun by the Beach Boys"}), | |
xdmp:document-insert("/doc3.xml",text{"Dogs are fun"}), | |
xdmp:document-insert("/doc4.xml",text{"Fun"}), | |
xdmp:document-insert("/doc5.xml",text{"Dogs are fun. Dogs are fun."}), | |
search:search("fun") |
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
<search:result index="1" uri="/doc2.xml" path="fn:doc("/doc2.xml")" score="3072" confidence="0.2275476" fitness="0.2886751"> | |
<search:snippet> | |
<search:match path="fn:doc("/doc2.xml")/text()"><search:highlight>Fun</search:highlight>, fun, fun by the Beach Boys<search:highlight>fun</search:highlight>, fun by the Beach Boys<search:highlight>fun</search:highlight> by the Beach Boys</search:match> | |
</search:snippet> | |
</search:result> |
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
<qry:relevance-info xmlns:qry="http://marklogic.com/cts/query"> | |
<qry:score formula="(256*scoreSum/weightSum)+(256*qualityWeight*documentQuality)" computation="(256*12/1)+(256*1*0)">3072</qry:score> | |
<qry:confidence formula="sqrt(score/(256*8*maxlogtf*maxidf))" computation="sqrt(3072/(256*8*18*log(5)))">0.2275476</qry:confidence> | |
<qry:fitness formula="sqrt(score/(256*8*maxlogtf*avgidf))" computation="sqrt(3072/(256*8*18*(0/1)))">0.2886751</qry:fitness> | |
<qry:uri>/doc2.xml</qry:uri> | |
<qry:path>fn:doc("/doc2.xml")</qry:path> | |
<qry:term weight="0.125"> | |
<qry:score formula="8*weight*logtf" computation="1*12">12</qry:score> | |
<qry:key>8828337839282077581</qry:key> | |
<qry:annotation>word("fun")</qry:annotation> |
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"; | |
import module namespace search = "http://marklogic.com/appservices/search" at "/MarkLogic/appservices/search/search.xqy"; | |
search:search("term", | |
<options xmlns="http://marklogic.com/appservices/search"> | |
<debug>true</debug> | |
<fragment-scope>properties</fragment-scope> | |
<sort-order type="xs:string" | |
collation="http://marklogic.com/collation/" |