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"; | |
(: Create the database and forest on current host :) | |
import module namespace admin="http://marklogic.com/xdmp/admin" | |
at "/MarkLogic/admin.xqy"; | |
let $config := admin:get-configuration() | |
let $config := | |
admin:database-create($config, "tweets", | |
xdmp:database("Security"), xdmp:database("Schemas")) | |
let $config := admin:forest-create($config, "tweetsF1", xdmp:host(), ()) |
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
<search:plan> | |
<qry:query-plan xmlns:qry="http://marklogic.com/cts/query"> | |
<qry:info-trace>xdmp:value("xdmp:plan(cts:search(fn:collection(),cts:query($query),$options,...")</qry:info-trace> | |
<qry:info-trace>Analyzing path for search: fn:collection()</qry:info-trace> | |
<qry:info-trace>Step 1 is searchable: fn:collection()</qry:info-trace> | |
<qry:info-trace>Path is fully searchable.</qry:info-trace> | |
<qry:info-trace>Gathering constraints.</qry:info-trace> | |
<qry:field-word-trace text="@NASA" field-name="tweet"> | |
<qry:key>12422997346279939379</qry:key> | |
</qry:field-word-trace> |
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
<search:plan> | |
<qry:query-plan xmlns:qry="http://marklogic.com/cts/query"> | |
<qry:info-trace>xdmp:value("xdmp:plan(cts:search(fn:collection(),cts:query($query),$options,...")</qry:info-trace> | |
<qry:info-trace>Analyzing path for search: fn:collection()</qry:info-trace> | |
<qry:info-trace>Step 1 is searchable: fn:collection()</qry:info-trace> | |
<qry:info-trace>Path is fully searchable.</qry:info-trace> | |
<qry:info-trace>Gathering constraints.</qry:info-trace> | |
<qry:word-trace text="NASA"> | |
<qry:key>3178996703552976097</qry:key> | |
</qry:word-trace> |
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
<options xmlns="http://marklogic.com/appservices/search"> | |
<search-option>unfiltered</search-option> | |
<quality-weight>0</quality-weight> | |
<return-plan>true</return-plan> | |
<debug>true</debug> | |
</options> |
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
<tweet>@NASA thanks for inviting me to the social! I'm learning so much!</tweet> | |
<tweet>Rumour has it NASA is announcing MSL finding organic carbon at press conference Tuesday.</tweet> | |
<tweet>Streambed on Mars! #NASA #MSL</tweet> |
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
<doc> | |
<user>spacecadet47</user> | |
<mobile>(650)701-1212</mobile> | |
<impact-score>45.21</impact-score> | |
<dt>2013-11-01T12:00:22</dt> | |
<location lat="34.156111" long="-118.1319443">Pasadena</location> | |
<tweet>@NASA thanks for inviting me to the social! I'm learning so much!</tweet> | |
</doc> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; | |
( | |
let $config := admin:get-configuration() | |
let $dbid := xdmp:database("barbecue") | |
let $rangespec := | |
admin:database-range-element-attribute-index("dateTime", | |
"http://example.com", "entry", "", "date", | |
"", fn:false() ) |
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"; | |
module namespace addr="http://example.org/address"; | |
declare namespace rxq="http://exquery.org/ns/restxq"; | |
declare | |
%rxq:GET | |
%rxq:path('/address/id/(.*)') | |
%rxq:produces('text/html') | |
function addr:get-address($id){ | |
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
declare variable $RESOURCE-URL := "@ml.resource-url"; | |
(: Becomes... :) | |
declare variable $RESOURCE-URL := "http://some.resource.com"; |