Jakob Fix | 9 Feb 00:29 2016
Picon
Gravatar

[MarkLogic Dev General] using node streams to write many documents into database

Hi,

I've found the documentation that explains how to use a WritableStream to get /one/ document into MarkLogic, but I couldn't find any example where it shows how one could stream /many thousands/ of documents.

The idea is to load a CSV file with > 1M lines as a ReadableStream and csv-parse and on each "readable" event to push the corresponding JSON object as a document into MarkLogic.

The signature for the db.documents.createWriteStream [1] seems to require a document URI to be present at the time of the stream creation, which I cannot supply at the stage of stream creation. The example given in the documentation on how to load many documents doesn't really scale to "big data proportions" ... [2].

Thanks for any help.
<div><div dir="ltr">Hi,<div><br></div>
<div>I've found the documentation that explains how to use a WritableStream to get /one/ document into MarkLogic, but I couldn't find any example where it shows how one could stream /many thousands/ of documents.</div>
<div><br></div>
<div>The idea is to load a CSV file with &gt; 1M lines as a ReadableStream and csv-parse and on each "readable" event to push the corresponding JSON object as a document into MarkLogic.</div>
<div><br></div>
<div>The signature for the db.documents.createWriteStream [1] seems to require a document URI to be present at the time of the stream creation, which I cannot supply at the stage of stream creation. The example given in the documentation on how to load many documents doesn't really scale to "big data proportions" ... [2].</div>
<div><br></div>
<div>Thanks for any help.</div>
<div>
<br clear="all"><div><div class="gmail_signature">cheers,<br>Jakob.</div></div>
<div class="gmail_signature"><br></div>
<div class="gmail_signature">[1] &nbsp;<a href="https://github.com/marklogic/node-client-api/blob/master/lib/documents.js#L468">https://github.com/marklogic/node-client-api/blob/master/lib/documents.js#L468</a>
</div>
<div class="gmail_signature">[2]&nbsp;<a href="http://docs.marklogic.com/guide/node-dev/documents#id_18341">http://docs.marklogic.com/guide/node-dev/documents#id_18341</a>&nbsp;</div>
</div>
</div></div>
Kapoor, Pragya | 5 Feb 08:00 2016

[MarkLogic Dev General] Data backup issye


Hi,


We are trying to backup one of our database and getting the below error:


Using admin console to backup data:

Error:

Info: Starting backup of forest BONY-Forest to /data/ITO/DB_Backup/BONY
2016-02-02 02:18:59.980 Error: Backup of forest BONY-Forest to /data/ITO/DB_Backup/BONY failed: SVC-FILCOPYX: Source file does not exist: /data/ITO/PROJECTS/forest/synopsys/BONY/Forests/BONY-Forest/Large/3dc/f7274b84c881aebc


Using XQSYNC:

error:

SEVERE : Error in document : /SourcePDFs/2013-07-09_07-59-02-805.pdf

Attaching the screenshot of the error.



We are storing xml in /docs/ directory and corresponding pdfs in "/SourcePDFs/" directory.

For some of the pdfs whose xml is present in the database and pdf is not present in DB we are getting the above error.


But how the server is getting the reference of those pdfs which are not present in the DB during the backup.

As per my understanding, it should backup whatever is present  in the database.


Please let me know, if we are missing anything.

We are using MarkLogic 5.0-3.


Thanks

Pragya

"This e-mail and any attachments transmitted with it are for the sole use of the intended recipient(s) and may contain confidential , proprietary or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this e-mail or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful."
<div>
<div>
<p><br></p>
<p>Hi,</p>
<p><br></p>
<p>We are trying to backup one of our database and getting the below error:</p>
<p><br></p>
<p>Using admin console to backup data:</p>
<p>Error:</p>
<p></p>
<div>Info: Starting backup of forest BONY-Forest to /data/ITO/DB_Backup/BONY</div>
<div>2016-02-02 02:18:59.980 Error: Backup of forest BONY-Forest to /data/ITO/DB_Backup/BONY failed: SVC-FILCOPYX: Source file does not exist: /data/ITO/PROJECTS/forest/synopsys/BONY/Forests/BONY-Forest/Large/3dc/f7274b84c881aebc</div>
<div><br></div>
<br><p></p>
<p>Using XQSYNC:</p>
<p>error:</p>
<p>SEVERE :&nbsp;Error in document :&nbsp;<span>/SourcePDFs/≤/span><span>2013-07-09_07-59-02-805.pdf</span></p>
<p>Attaching the screenshot of the error.<br><span></span></p>
<div><br></div>
<div><br></div>
<p></p>
<p>We are storing xml in /docs/ directory and corresponding pdfs in "/SourcePDFs/" directory.</p>
<p>For some of the pdfs whose xml is present in the database and pdf is not present in DB we are getting the above error.</p>
<p><br></p>
<p>But how the server is getting the reference of those pdfs which are not present in the DB&nbsp;during the backup.</p>
<p>As per my understanding, it should backup whatever is present &nbsp;in the database.</p>
<p><br></p>
<p>Please let me know, if we are missing anything.</p>
<p>We are using MarkLogic 5.0-3.</p>
<p><br></p>
<p>Thanks</p>
<p>Pragya</p>
</div>
"This e-mail and any attachments transmitted with it are for the sole use of the intended recipient(s) and may contain confidential , proprietary or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and
 destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this e-mail or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful."
</div>
Gontla Praveen | 5 Feb 04:27 2016
Picon

[MarkLogic Dev General] Field indexes in ML7.0

Hi All,

Can someone help me to validate the field path that i am trying to create

I have a document which matches my xpath

x:a/x:b//y:c [*:type = "xyz"]

Even though my db contains documents which contains this xpaths I am unable to retrieve that document using cts field word query.

I have re-indexed the db after creating this field path as well.

Can someone help me why I am unable to retrieve the document?

Thanks,
Praveen.

<div>
<p dir="ltr">Hi All,</p>
<p dir="ltr">Can someone help me to validate the field path that i am trying to create<br></p>
<p dir="ltr">I have a document which matches my xpath</p>
<p dir="ltr">x:a/x:b//y:c [*:type = "xyz"]</p>
<p dir="ltr">Even though my db contains documents which contains this xpaths I am unable to retrieve that document using cts field word query.</p>
<p dir="ltr">I have re-indexed the db after creating this field path as well.</p>
<p dir="ltr">Can someone help me why I am unable to retrieve the document? </p>
<p dir="ltr">Thanks,<br>
Praveen.</p>
</div>
Danny Sinang | 4 Feb 22:05 2016
Picon

[MarkLogic Dev General] Multiple CDATA inside one element

I enabled CDATA output for an element named "content" and it appeared to have worked, except that ML created two CDATA sections inside that element like this :

<content type="string">
<![CDATA[<p><strong>The Challenge</strong></p> <p>Ample research has shown that for complex surgical procedures, ... is now]]><![CDATA[expected to do at least ...]]>

</content>

Shouldn't there only be 1 CDATA section in it ? What could have caused 2 to be created ? Is there a workaround ?

Regards,
Danny

<div><div dir="ltr">I enabled CDATA output for an element named "content" and it appeared to have worked, except that ML created two CDATA sections inside that element like this :<div><br></div>
<div>
<span>&lt;</span><span class="">content</span><span>&nbsp;</span><span class=""><span class="">type</span>="<span class="">string</span>"</span><span>&gt;</span><br>
</div>
<div>
<span class=""><span class="">&lt;![CDATA[</span><span class="">&lt;p&gt;&lt;strong&gt;The Challenge&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Ample research has shown that for complex surgical procedures, ... is now</span><span class="">]]&gt;</span></span><span class=""><span class=""></span><span class="">&lt;![CDATA[</span><span class="">expected to do at least ...</span><span class=""><span>]]&gt;</span><br></span></span><div><br></div>
<div>
<span>&lt;/</span><span class="">content</span><span>&gt;</span><br>
</div>
</div>
<div><br></div>
<div>Shouldn't there only be 1 CDATA section in it ? What could have caused 2 to be created ? Is there a workaround ?</div>
<div><br></div>
<div>Regards,</div>
<div>Danny</div>
<div><br></div>
</div></div>
Danny Sinang | 4 Feb 21:48 2016
Picon

[MarkLogic Dev General] Getting pairs or triples of words that appear frequently together ?

I've got one element with a paragraph of text.  

I want to surface words that frequently appear together in the blob of text.  

I can get the individual words easily using cts:element-words, but how do I get pairs or triples of words that appear frequently together ?

Regards,
Danny

<div><div dir="ltr">
<div>I've got one element with a paragraph of text. &nbsp;<br>
</div>
<div><br></div>
<div>I want to surface words that frequently appear together in the blob of text. &nbsp;</div>
<div><br></div>
<div>I can get the individual words easily using cts:element-words, but how do I get pairs or triples of words that appear frequently together ?<br>
</div>
<div><br></div>
<div>Regards,<br>Danny</div>
<div><br></div>
</div></div>
Florent Georges | 4 Feb 15:37 2016

[MarkLogic Dev General] URI pattern match function

Hi,

The function cts:uri-matches takes a URI pattern as a parameter.
Something that looks a bit like a file glob in Shell:
/foo/*/bar-*.xml.

Is there a function that returns whether a given string matches such a
pattern?  A bit like fn:matches, but for a URI pattern instead of a
proper regex.

Regards,

--

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/
mcundiff1 | 2 Feb 17:51 2016
Picon
Picon

[MarkLogic Dev General] ec2 connect issues

I have an instance of ML set up on AWS EC2. Heretofore all has worked well but am having trouble today.

On the EC2 console it shows my instance with ML running with no problems.

I am able to connect to ML qconsole with no problem.
http://ec2-xx-xx-xx-xxx.compute-1.amazonaws.com:8000/qconsole/

I cannot connect to ML Admin page (ERR_CONNECTION_REFUSED in Chrome)
http://ec2-xx-xx-xx-xxx.compute-1.amazonaws.com:8001/


I cannot to connect to any of the other web pages I had created on other ports.

Any help appreciate d.

Morgan
<div><div>
<div aria-label="Compose body">
<div>I have an instance of ML set up on AWS EC2. Heretofore all has worked well but am having trouble today.</div>
<div><br></div>On the EC2 console it shows my instance with ML running with no problems.</div>
<div><br></div>
<div>I am able to connect to ML qconsole with no problem.<br>
</div>
<div>http://ec2-xx-xx-xx-xxx.compute-1.amazonaws.com:8000/qconsole/<br>
</div>
<div><br></div>
<div>I cannot connect to ML Admin page (ERR_CONNECTION_REFUSED in Chrome)<br>
</div>
<div>http://ec2-xx-xx-xx-xxx.compute-1.amazonaws.com:8001/</div>
<div><br></div>
<div><br></div>
<div>I cannot to connect to any of the other web pages I had created on other ports.<br>
</div>
<div><br></div>
<div>Any help appreciate
 d.<br>
</div>
<div><br></div>
<div>Morgan<br>
</div>
</div></div>
Ashley Peacock | 2 Feb 16:55 2016
Picon

[MarkLogic Dev General] Dynamically Create View Based On Indexes

Hey,

 

I have the basic idea of how to achieve creating a view based on the current indexes on a field, I just can’t tie all the pieces together so hoping someone can help!

 

When calling admin:database-get-range-element-indexes() it returns a bunch of XML defining the indexes. I want to loop through each index, retrieve some values (the XML looks something like:

 

2016-02-02 14:14:28.322 Info: TaskServer: <range-element-index xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://marklogic.com/xdmp/database">

2016-02-02 14:14:28.322 Info: TaskServer:   <scalar-type>int</scalar-type>

2016-02-02 14:14:28.322 Info: TaskServer:   <collation/>

2016-02-02 14:14:28.322 Info: TaskServer:   <namespace-uri/>

2016-02-02 14:14:28.322 Info: TaskServer:   <localname>localname</localname>

2016-02-02 14:14:28.322 Info: TaskServer:   <range-value-positions>true</range-value-positions>

2016-02-02 14:14:28.322 Info: TaskServer:   <invalid-values>ignore</invalid-values>

2016-02-02 14:14:28.322 Info: TaskServer: </range-element-index>

 

And store then in a sequence. I’ve tried the below to no luck, as my XQuery is not the strongest.

 

Let $seq := ()

For $i in admin:database-get-range-element-indexes(admin:get-configuration(), xdmp:database(‘myDatabase’))

Return fn:insert-before($seq, 0, view:column($i/range-element-index/localname, $i/range-element-index/localname)

 

But that doesn’t seem to work (there’s no error, it just doesn’t “do” anything).


Does anyone have any ideas?

 

Thanks,

 

Ashley

 

Ashley Peacock

Developer II
Elevate Credit International Limited
P: 01284 717800 | Ext: 877 |  Elevate.co.uk
Amadeus House, Floral Street, Covent Garden, London WC2E 9DP

 

Privileged and Confidential. This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain privileged and/or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited. 

Elevate Credit International Limited is registered in England & Wales with Company Number 05041905. Registered Office: 27-28 Eastcastle Street, London, W1W 8DH

 

<div>
<p class="e807e944-da6a-4014-a7f5-b1b21ef0eeb6"></p>
<div class="WordSection1">
<p class="MsoNormal">Hey,<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">I have the basic idea of how to achieve creating a view based on the current indexes on a field, I just can&rsquo;t tie all the pieces together so hoping someone can help!<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">When calling admin:database-get-range-element-indexes() it returns a bunch of XML defining the indexes. I want to loop through each index, retrieve some values (the XML looks something like:<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">2016-02-02 14:14:28.322 Info: TaskServer: &lt;range-element-index xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://marklogic.com/xdmp/database"&gt;<p></p></p>
<p class="MsoNormal">2016-02-02 14:14:28.322 Info: TaskServer:&nbsp;&nbsp; &lt;scalar-type&gt;int&lt;/scalar-type&gt;<p></p></p>
<p class="MsoNormal">2016-02-02 14:14:28.322 Info: TaskServer:&nbsp;&nbsp; &lt;collation/&gt;<p></p></p>
<p class="MsoNormal">2016-02-02 14:14:28.322 Info: TaskServer:&nbsp;&nbsp; &lt;namespace-uri/&gt;<p></p></p>
<p class="MsoNormal">2016-02-02 14:14:28.322 Info: TaskServer:&nbsp;&nbsp; &lt;localname&gt;localname&lt;/localname&gt;<p></p></p>
<p class="MsoNormal">2016-02-02 14:14:28.322 Info: TaskServer:&nbsp;&nbsp; &lt;range-value-positions&gt;true&lt;/range-value-positions&gt;<p></p></p>
<p class="MsoNormal">2016-02-02 14:14:28.322 Info: TaskServer:&nbsp;&nbsp; &lt;invalid-values&gt;ignore&lt;/invalid-values&gt;<p></p></p>
<p class="MsoNormal">2016-02-02 14:14:28.322 Info: TaskServer: &lt;/range-element-index&gt;<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">And store then in a sequence. I&rsquo;ve tried the below to no luck, as my XQuery is not the strongest.<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Let $seq := ()<p></p></p>
<p class="MsoNormal">For $i in admin:database-get-range-element-indexes(admin:get-configuration(), xdmp:database(&lsquo;myDatabase&rsquo;))<p></p></p>
<p class="MsoNormal">Return fn:insert-before($seq, 0, view:column($i/range-element-index/localname, $i/range-element-index/localname)<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">But that doesn&rsquo;t seem to work (there&rsquo;s no error, it just doesn&rsquo;t &ldquo;do&rdquo; anything).<p></p></p>
<p class="MsoNormal"><br>
Does anyone have any ideas?<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Thanks,<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Ashley<p></p></p>
</div>
<p></p>
<p class="e807e944-da6a-4014-a7f5-b1b21ef0eeb6">&nbsp;</p>
<p class="e807e944-da6a-4014-a7f5-b1b21ef0eeb6">
</p>
<table cellpadding="0" border="0">
<tr>
<td valign="top" rowspan="3" width="75">
<p align="center"></p>
</td>
<td width="75">
<p></p>
</td>
<td width="300"></td>
</tr>
<tr>
<td colspan="2">
<p><span>Ashley Peacock</span></p>
</td>
</tr>
<tr>
<td valign="top" colspan="2">
<p><span>Developer II</span><br>Elevate Credit International Limited<br><span></span><span>P: 01284 717800 |
</span><span>Ext: 877 | </span>&nbsp;<span><span><a href="http://elevate.co.uk" title="" target=""><span>Elevate.co.uk</span></a></span></span><br>Amadeus&nbsp;House,&nbsp;Floral Street, Covent Garden,&nbsp;London WC2E 9DP</p>
</td>
</tr>
</table>
<p class="e807e944-da6a-4014-a7f5-b1b21ef0eeb6">&nbsp;</p>
<p class="e807e944-da6a-4014-a7f5-b1b21ef0eeb6"><span>Privileged and Confidential. This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain
 privileged and/or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any
 attachments thereto, is strictly prohibited.&nbsp;<br><br>
Elevate Credit International Limited&nbsp;is registered in England &amp; Wales with Company Number 05041905. Registered Office:
<span>
27-28 Eastcastle Street, London, W1W 8DH</span></span></p>
<p class="e807e944-da6a-4014-a7f5-b1b21ef0eeb6">&nbsp;</p>
<p class="e807e944-da6a-4014-a7f5-b1b21ef0eeb6"></p>
</div>
Ashley Peacock | 1 Feb 13:27 2016
Picon

[MarkLogic Dev General] HTTP GET Help

Hey,

 

I am using the following script in my CPF application, on insert. It worked fine when it was just adding the extra <insert_timestamp /> node, as well as the searchable collection, however I’m trying to make a HTTP GET call and check the response via logging but it throws an error:

 

<error:code>XDMP-UNDVAR</error:code>
      <error:name>err:XPST0008</error:name>
      <error:xquery-version>1.0-ml</error:xquery-version>
      <error:message>Undefined variable</error:message>
      <error:format-string>XDMP-UNDVAR: (err:XPST0008) Undefined variable $serverResponse</error:format-string>
      <error:retryable>false</error:retryable>
      <error:expr> </error:expr>
      <error:data>

 

My code is:

 

xquery version "1.0-ml";

import module namespace cpf="http://marklogic.com/cpf"

  at "/MarkLogic/cpf/cpf.xqy";

declare variable $cpf:document-uri as xs:string external;

declare variable $cpf:transition as node() external;

if (cpf:check-transition($cpf:document-uri,$cpf:transition)) then try {

  let $doc := fn:doc($cpf:document-uri)

 

  let $serverResponse := xdmp:http-get("my-url")

     (: <options xmlns="xdmp:http">

       <authentication method="basic">

         <username>myname</username>

         <password>mypassword</password>

       </authentication>

       <data>{$cpf:document-uri}</data>

       <headers>

         <content-type>text/plain</content-type>

       </headers>

     </options>) :)

 

return xdmp:node-insert-child($doc/root, <insert_timestamp>{fn:current-dateTime()}</insert_timestamp>),

  xdmp:document-add-collections($cpf:document-uri, ("searchable")),

  xdmp:log(fn:concat('VARABLE: ', $serverResponse)),

  cpf:success($cpf:document-uri, $cpf:transition, ())

} catch ($e) {

  cpf:failure($cpf:document-uri, $cpf:transition, $e, ())

}

else ()

 

Does anyone know why the this isn’t working?

 

As an FYI, I can make a curl call to the URL fine from the command line and it returns what I expect. If I remove the xmdp:log() call, it also processes fine… I just have no way of seeing the output though.

 

Thanks,

 

Ashley

 

Ashley Peacock

Developer II
Elevate Credit International Limited
P: 01284 717800 | Ext: 877 |  Elevate.co.uk
Amadeus House, Floral Street, Covent Garden, London WC2E 9DP

 

Privileged and Confidential. This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain privileged and/or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited. 

Elevate Credit International Limited is registered in England & Wales with Company Number 05041905. Registered Office: 27-28 Eastcastle Street, London, W1W 8DH

 

<div>
<p class="e807e944-da6a-4014-a7f5-b1b21ef0eeb6"></p>
<div class="WordSection1">
<p class="MsoNormal">Hey,<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">I am using the following script in my CPF application, on insert. It worked fine when it was just adding the extra &lt;insert_timestamp /&gt; node, as well as the searchable collection, however I&rsquo;m trying to make a HTTP GET call and check the
 response via logging but it throws an error:<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><span>&lt;error:code&gt;XDMP-UNDVAR&lt;/error:code&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;error:name&gt;err:XPST0008&lt;/error:name&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;error:xquery-version&gt;1.0-ml&lt;/error:xquery-version&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;error:message&gt;Undefined variable&lt;/error:message&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;error:format-string&gt;XDMP-UNDVAR: (err:XPST0008) Undefined variable $serverResponse&lt;/error:format-string&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&lt;error:retryable&gt;false&lt;/error:retryable&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;error:expr&gt; &lt;/error:expr&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;error:data&gt;<p></p></span></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">My code is:<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">xquery version "1.0-ml";<p></p></p>
<p class="MsoNormal">import module namespace cpf="http://marklogic.com/cpf"<p></p></p>
<p class="MsoNormal">&nbsp; at "/MarkLogic/cpf/cpf.xqy";<p></p></p>
<p class="MsoNormal">declare variable $cpf:document-uri as xs:string external;<p></p></p>
<p class="MsoNormal">declare variable $cpf:transition as node() external;<p></p></p>
<p class="MsoNormal">if (cpf:check-transition($cpf:document-uri,$cpf:transition)) then try {<p></p></p>
<p class="MsoNormal">&nbsp; let $doc := fn:doc($cpf:document-uri)<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">&nbsp; let $serverResponse := xdmp:http-get("my-url")<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp; (: &lt;options xmlns="xdmp:http"&gt;<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;authentication method="basic"&gt;<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;username&gt;myname&lt;/username&gt;<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;password&gt;mypassword&lt;/password&gt;<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/authentication&gt;<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;data&gt;{$cpf:document-uri}&lt;/data&gt;<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;headers&gt;<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;content-type&gt;text/plain&lt;/content-type&gt;<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/headers&gt;<p></p></p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp; &lt;/options&gt;) :)<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">return xdmp:node-insert-child($doc/root, &lt;insert_timestamp&gt;{fn:current-dateTime()}&lt;/insert_timestamp&gt;),<p></p></p>
<p class="MsoNormal">&nbsp; xdmp:document-add-collections($cpf:document-uri, ("searchable")),<p></p></p>
<p class="MsoNormal">&nbsp; xdmp:log(fn:concat('VARABLE: ', $serverResponse)),<p></p></p>
<p class="MsoNormal">&nbsp; cpf:success($cpf:document-uri, $cpf:transition, ())<p></p></p>
<p class="MsoNormal">} catch ($e) {<p></p></p>
<p class="MsoNormal">&nbsp; cpf:failure($cpf:document-uri, $cpf:transition, $e, ())<p></p></p>
<p class="MsoNormal">}<p></p></p>
<p class="MsoNormal">else ()<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Does anyone know why the this isn&rsquo;t working?<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">As an FYI, I can make a curl call to the URL fine from the command line and it returns what I expect. If I remove the xmdp:log() call, it also processes fine&hellip; I just have no way of seeing the output though.<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Thanks,<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Ashley<p></p></p>
</div>
<p></p>
<p class="e807e944-da6a-4014-a7f5-b1b21ef0eeb6">&nbsp;</p>
<p class="e807e944-da6a-4014-a7f5-b1b21ef0eeb6">
</p>
<table cellpadding="0" border="0">
<tr>
<td valign="top" rowspan="3" width="75">
<p align="center"></p>
</td>
<td width="75">
<p></p>
</td>
<td width="300"></td>
</tr>
<tr>
<td colspan="2">
<p><span>Ashley Peacock</span></p>
</td>
</tr>
<tr>
<td valign="top" colspan="2">
<p><span>Developer II</span><br>Elevate Credit International Limited<br><span></span><span>P: 01284 717800 |
</span><span>Ext: 877 | </span>&nbsp;<span><span><a href="http://elevate.co.uk" title="" target=""><span>Elevate.co.uk</span></a></span></span><br>Amadeus&nbsp;House,&nbsp;Floral Street, Covent Garden,&nbsp;London WC2E 9DP</p>
</td>
</tr>
</table>
<p class="e807e944-da6a-4014-a7f5-b1b21ef0eeb6">&nbsp;</p>
<p class="e807e944-da6a-4014-a7f5-b1b21ef0eeb6"><span>Privileged and Confidential. This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain
 privileged and/or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any
 attachments thereto, is strictly prohibited.&nbsp;<br><br>
Elevate Credit International Limited&nbsp;is registered in England &amp; Wales with Company Number 05041905. Registered Office:
<span>
27-28 Eastcastle Street, London, W1W 8DH</span></span></p>
<p class="e807e944-da6a-4014-a7f5-b1b21ef0eeb6">&nbsp;</p>
<p class="e807e944-da6a-4014-a7f5-b1b21ef0eeb6"></p>
</div>
Ganesh Vaideeswaran | 1 Feb 05:13 2016

[MarkLogic Dev General] Recall: MLCP input query

Ganesh Vaideeswaran would like to recall the message, "[MarkLogic Dev General] MLCP input query".
Ganesh Vaideeswaran | 1 Feb 05:13 2016

[MarkLogic Dev General] Recall: MLCP input query

Ganesh Vaideeswaran would like to recall the message, "[MarkLogic Dev General] MLCP input query".

Gmane