Prasanth N V R | 18 Apr 07:13 2015
Picon

[MarkLogic Dev General] XQuery memory on Marklogic

Hi,


I need to check how much Marklogic memory is utilized for an xquery.

Is there a way to check the string variable, map:map, etc memory utilization when executed in an xquery file?

Thanks,
Prasanth


<div>
<p>Hi,</p>
<div><br></div>
<div>I need to check how much Marklogic memory is utilized for an xquery.</div>
<div><br></div>
<div>Is there a way to check the string variable, map:map, etc memory utilization when executed in an xquery file?</div>
<div><br></div>
<div>Thanks,</div>
<div>Prasanth</div>
<div><br></div>
<div><br></div>
</div>
Yinyan guy | 17 Apr 15:25 2015
Picon

[MarkLogic Dev General] XDMP-UNDFUN: (err:XPST0017) Undefined function conf:rewrite()

<!-- .hmmessage P { margin:0px; padding:0px } body.hmmessage { font-size: 12pt; font-family:Calibri } -->
Hi All,
I am trying the rest-5min-guide sample project installed with database. I am using Marklogic 8.0.2 on mac. While trying to deploy the code after bootstrap(ing) the roxy project, I get the following error

ERROR: 500 "Internal Server Error"

ERROR: <error:error xsi:schemaLocation="http://marklogic.com/xdmp/error error.xsd" xmlns:error="http://marklogic.com/xdmp/error" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <error:code>XDMP-UNDFUN</error:code>

  <error:name>err:XPST0017</error:name>

  <error:xquery-version>1.0-ml</error:xquery-version>

  <error:message>Undefined function</error:message>

  <error:format-string>XDMP-UNDFUN: (err:XPST0017) Undefined function conf:rewrite()</error:format-string>

  <error:retryable>false</error:retryable>

  <error:expr> </error:expr>

  <error:data>

    <error:datum>conf:rewrite()</error:datum>

  </error:data>

  <error:stack>

    <error:frame>

      <error:line>7</error:line>

      <error:column>9</error:column>

      <error:operation>xdmp:eval("&amp;#10;        import module namespace conf = &amp;quot;http://marklog...", (fn:QName("","method"), "PUT", fn:QName("","uri"), ...))</error:operation>

      <error:xquery-version>1.0-ml</error:xquery-version>

    </error:frame>

    <error:frame>

      <error:uri>/roxy/rewrite.xqy</error:uri>

      <error:line>40</error:line>

      <error:column>6</error:column>

      <error:variables>

<error:variable>

  <error:name xmlns="">uri</error:name>

  <error:value>"/v1/config/properties"</error:value>

</error:variable>

<error:variable>

  <error:name xmlns="">method</error:name>

  <error:value>"PUT"</error:value>

</error:variable>

<error:variable>

  <error:name xmlns="">path</error:name>

  <error:value>"/v1/config/properties"</error:value>

</error:variable>

<error:variable>

  <error:name xmlns="">final-uri</error:name>

  <error:value>()</error:value>

</error:variable>

      </error:variables>

      <error:xquery-version>1.0-ml</error:xquery-version>

    </error:frame>

  </error:stack>

</error:error>

 I haven't modified any of the files. I tried going to the line 40 of the /roxy/rewrite.xqy file but the did not find anything unusual (Attaching the file). 


Any tips on finding out the reason would be helpful.

regards,

Puneet


Attachment (rewrite.xqy): application/octet-stream, 2477 bytes
<div><div dir="ltr">

&lt;!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--&gt;<div dir="ltr">Hi All,<div>I am trying the rest-5min-guide sample project installed with database. I am using Marklogic 8.0.2 on mac. While trying to deploy the code after bootstrap(ing) the roxy project, I get the following error</div>
<div><br></div>
<div>

<p class="p1">ERROR: 500 "Internal Server Error"</p>
<p class="p1">ERROR: &lt;error:error xsi:schemaLocation="http://marklogic.com/xdmp/error error.xsd" xmlns:error="http://marklogic.com/xdmp/error" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;</p>
<p class="p1">&nbsp; &lt;error:code&gt;XDMP-UNDFUN&lt;/error:code&gt;</p>
<p class="p1">&nbsp; &lt;error:name&gt;err:XPST0017&lt;/error:name&gt;</p>
<p class="p1">&nbsp; &lt;error:xquery-version&gt;1.0-ml&lt;/error:xquery-version&gt;</p>
<p class="p1">&nbsp; &lt;error:message&gt;Undefined function&lt;/error:message&gt;</p>
<p class="p1">&nbsp; &lt;error:format-string&gt;XDMP-UNDFUN: (err:XPST0017) Undefined function conf:rewrite()&lt;/error:format-string&gt;</p>
<p class="p1">&nbsp; &lt;error:retryable&gt;false&lt;/error:retryable&gt;</p>
<p class="p1">&nbsp; &lt;error:expr&gt; &lt;/error:expr&gt;</p>
<p class="p1">&nbsp; &lt;error:data&gt;</p>
<p class="p1">&nbsp; &nbsp; &lt;error:datum&gt;conf:rewrite()&lt;/error:datum&gt;</p>
<p class="p1">&nbsp; &lt;/error:data&gt;</p>
<p class="p1">&nbsp; &lt;error:stack&gt;</p>
<p class="p1">&nbsp; &nbsp; &lt;error:frame&gt;</p>
<p class="p1">&nbsp; &nbsp; &nbsp; &lt;error:line&gt;7&lt;/error:line&gt;</p>
<p class="p1">&nbsp; &nbsp; &nbsp; &lt;error:column&gt;9&lt;/error:column&gt;</p>
<p class="p1">&nbsp; &nbsp; &nbsp; &lt;error:operation&gt;xdmp:eval("&amp;amp;#10;&nbsp; &nbsp; &nbsp; &nbsp; import module namespace conf = &amp;amp;quot;http://marklog...", (fn:QName("","method"), "PUT", fn:QName("","uri"), ...))&lt;/error:operation&gt;</p>
<p class="p1">&nbsp; &nbsp; &nbsp; &lt;error:xquery-version&gt;1.0-ml&lt;/error:xquery-version&gt;</p>
<p class="p1">&nbsp; &nbsp; &lt;/error:frame&gt;</p>
<p class="p1">&nbsp; &nbsp; &lt;error:frame&gt;</p>
<p class="p1">&nbsp; &nbsp; &nbsp; &lt;error:uri&gt;/roxy/rewrite.xqy&lt;/error:uri&gt;</p>
<p class="p1">&nbsp; &nbsp; &nbsp; &lt;error:line&gt;40&lt;/error:line&gt;</p>
<p class="p1">&nbsp; &nbsp; &nbsp; &lt;error:column&gt;6&lt;/error:column&gt;</p>
<p class="p1">&nbsp; &nbsp; &nbsp; &lt;error:variables&gt;</p>
<p class="p1"><span class="Apple-tab-span">	</span>&lt;error:variable&gt;</p>
<p class="p1"><span class="Apple-tab-span">	</span>&nbsp; &lt;error:name xmlns=""&gt;uri&lt;/error:name&gt;</p>
<p class="p1"><span class="Apple-tab-span">	</span>&nbsp; &lt;error:value&gt;"/v1/config/properties"&lt;/error:value&gt;</p>
<p class="p1"><span class="Apple-tab-span">	</span>&lt;/error:variable&gt;</p>
<p class="p1"><span class="Apple-tab-span">	</span>&lt;error:variable&gt;</p>
<p class="p1"><span class="Apple-tab-span">	</span>&nbsp; &lt;error:name xmlns=""&gt;method&lt;/error:name&gt;</p>
<p class="p1"><span class="Apple-tab-span">	</span>&nbsp; &lt;error:value&gt;"PUT"&lt;/error:value&gt;</p>
<p class="p1"><span class="Apple-tab-span">	</span>&lt;/error:variable&gt;</p>
<p class="p1"><span class="Apple-tab-span">	</span>&lt;error:variable&gt;</p>
<p class="p1"><span class="Apple-tab-span">	</span>&nbsp; &lt;error:name xmlns=""&gt;path&lt;/error:name&gt;</p>
<p class="p1"><span class="Apple-tab-span">	</span>&nbsp; &lt;error:value&gt;"/v1/config/properties"&lt;/error:value&gt;</p>
<p class="p1"><span class="Apple-tab-span">	</span>&lt;/error:variable&gt;</p>
<p class="p1"><span class="Apple-tab-span">	</span>&lt;error:variable&gt;</p>
<p class="p1"><span class="Apple-tab-span">	</span>&nbsp; &lt;error:name xmlns=""&gt;final-uri&lt;/error:name&gt;</p>
<p class="p1"><span class="Apple-tab-span">	</span>&nbsp; &lt;error:value&gt;()&lt;/error:value&gt;</p>
<p class="p1"><span class="Apple-tab-span">	</span>&lt;/error:variable&gt;</p>
<p class="p1">&nbsp; &nbsp; &nbsp; &lt;/error:variables&gt;</p>
<p class="p1">&nbsp; &nbsp; &nbsp; &lt;error:xquery-version&gt;1.0-ml&lt;/error:xquery-version&gt;</p>
<p class="p1">&nbsp; &nbsp; &lt;/error:frame&gt;</p>
<p class="p1">&nbsp; &lt;/error:stack&gt;</p>
<p class="p1">&lt;/error:error&gt;</p>
<p class="p1">&nbsp;I haven't modified any of the files. I tried going to the line 40 of the&nbsp;<span>/roxy/rewrite.xqy file but the did not find anything&nbsp;</span>unusual<span>&nbsp;(Attaching&nbsp;the file).&nbsp;</span></p>
<p class="p1"><span><br></span></p>
<p class="p1"><span>Any tips on finding out the reason would be helpful.</span></p>
<p class="p1"><span>regards,</span></p>
<p class="p1">Puneet</p>
<p class="p1"><br></p>
</div>
</div>
 		 	   		  </div></div>
Danny Sinang | 17 Apr 14:36 2015
Picon

[MarkLogic Dev General] Adding JSON array members in ML8

I've read about ML8's JSON constructors so I started rewriting my ML7 XQuery for better readabilty.

Below is my ML8 code (which I haven't tested yet) which has a for loop that adds members to a JSON array.

My question is, is there another way (more akin to constructors) of adding members to a JSON array other than calling json:array-push ?

Regards,
Danny


    let $main-array := array-node { }
    let $_ :=
              for $type in $values
              let $type-name := helper:get-type-name($chart-name, $type)                 
              return
                 json:array-push ($main-array, object-node { "name" : $type-name,
                                                             "children" : array-node {
                                                                                object-node { "name" : $type-name,
                                                                                              "id" : helper:get-clean-id ($type),
                                                                                              "size" : cts:frequency($type)
                                                                                }
                                                                          }
                                               }                
                
                 )
    let $main-object := object-node { "name" : "flare", "children" : $main-array }       

<div><div dir="ltr">I've read about ML8's JSON constructors so I started rewriting my ML7 XQuery for better readabilty.<div><br></div>
<div>Below is my ML8 code (which I haven't tested yet) which has a for loop that adds members to a JSON array.</div>
<div><br></div>
<div>My question is, is there another way (more akin to constructors) of adding members to a JSON array other than calling json:array-push ?</div>
<div><br></div>
<div>Regards,<br>Danny</div>
<div><br></div>
<div><br></div>
<div>







<p class="">&nbsp; &nbsp;&nbsp;<span class="">let </span><span class="">$main-array</span> := <span class="">array-node</span> { }<br>
&nbsp; &nbsp; <span class="">let</span> <span class="">$_</span> := <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="">for </span><span class="">$type</span> <span class="">in </span><span class="">$values</span><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="">let</span> <span class="">$type-name</span> := <span class="">helper:get-type-name</span>(<span class="">$chart-name</span>, <span class="">$type</span>)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="">return</span><br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="">json:array-push</span> (<span class="">$main-array</span>, <span class="">object-node</span> { <span class="">"name"</span> : $type-name, <br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="">"children"</span> : array-node {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="">object-node</span> { <span class="">"name"</span> : $type-name, <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="">"id"</span> : helper:get-clean-id ($type),<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="">"size"</span> : cts:frequency($type) <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } <br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ) <br>
&nbsp; &nbsp; <span class="">let</span> <span class="">$main-object</span> := <span class="">object-node</span> { <span class="">"name"</span> : "flare", "children" : $main-array }&nbsp; &nbsp; &nbsp; &nbsp;</p>
</div>
</div></div>
Danny Sinang | 16 Apr 23:58 2015
Picon

[MarkLogic Dev General] XQuery editor that supports jumping to function declaration

Slightly off-topic ...

Does anyone know of an XQuery Editor that supports jumping to function declarations (within the same source file and otherwise) by CMD-clicking on a function call ?

I know this feature exists in Eclipse when editing Java and it is very useful / convenient.

Regards,
Danny

<div><div dir="ltr">
<div>Slightly off-topic ...</div>
<div><br></div>Does anyone know of an XQuery Editor that supports jumping to function declarations (within the same source file and otherwise) by CMD-clicking on a function call ?<div><br></div>
<div>I know this feature exists in Eclipse when editing Java and it is very useful / convenient.</div>
<div><br></div>
<div>Regards,<br>Danny</div>
<div><br></div>
</div></div>
Danny Sinang | 16 Apr 19:11 2015
Picon

[MarkLogic Dev General] Preserving document collection membership

We sometimes modify XML docs in ML by hand (via WebDav  / Oxygen)  and discover later on that that XML doc is no longer part of its previous collection(s).

Is there a way to tell ML to preserve collection membership when changed via the said method ?

Regards,
Danny


<div><div dir="ltr">We sometimes modify XML docs in ML by hand (via WebDav &nbsp;/ Oxygen) &nbsp;and discover later on that that XML doc is no longer part of its previous collection(s).<div><br></div>
<div>Is there a way to tell ML to preserve collection membership when changed via the said method ?</div>
<div><br></div>
<div>Regards,<br>Danny</div>
<div><br></div>
<div><br></div>
</div></div>
Andreas Hubmer | 16 Apr 11:15 2015

[MarkLogic Dev General] rest-writer and URI privileges

Hi,

I would like to restrict the URIs for which a user can create documents via REST.

My setup so far is:
* a user 'app-user' which is assigned the role 'app-role' (nothing else)
* no other role is assigned to the 'app-role'
* the 'app-role' has execute privileges for rest-reader, rest-writer and xdbc:invoke (for non-rest calls)
* the 'app-role' has default permissions for update and read

It surprises me that the user is able to create arbitrary documents via REST. I would expect that URI privileges or the unprotected-uri/any-uri execute privilege are necessary.

Is there anything I am missing?
How can I restrict the URIs for which the REST user can create documents?

Regards,
Andreas


--
Andreas Hubmer
IT Consultant

EBCONT enterprise technologies GmbH 

OUR TEAM IS YOUR SUCCESS

UID-Nr. ATU68135644
HG St.Pölten - FN 399978 d
<div><div dir="ltr">Hi,<div><br></div>
<div>I would like to restrict the URIs for which a user can create documents via REST.</div>
<div><br></div>
<div>My setup so far is:</div>
<div>* a user 'app-user' which is assigned the role 'app-role' (nothing else)</div>
<div>* no other role is assigned to the 'app-role'</div>
<div>* the 'app-role' has execute privileges for rest-reader, rest-writer and&nbsp;xdbc:invoke (for non-rest calls)</div>
<div>* the 'app-role' has default permissions for update and read</div>
<div><br></div>
<div>It surprises me that the user is able to create arbitrary documents via REST. I would expect that URI privileges or the&nbsp;unprotected-uri/any-uri execute privilege are necessary.</div>
<div><br></div>
<div>Is there anything I am missing?</div>
<div>How can I restrict the URIs for which the REST user can create documents?</div>
<div><br></div>
<div>Regards,</div>
<div>Andreas</div>
<div>
<br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr">
<div dir="ltr">
<span>Andreas Hubmer</span><br>
</div>
<div>IT Consultant</div>
<div dir="ltr"><br></div>
<div dir="ltr">EBCONT enterprise technologies GmbH&nbsp;</div>
<div dir="ltr"><br></div>
<div dir="ltr">OUR TEAM IS YOUR SUCCESS</div>
<div dir="ltr"><br></div>
<div dir="ltr">UID-Nr. ATU68135644</div>
<div dir="ltr">HG St.P&ouml;lten - FN 399978 d</div>
</div></div></div></div>
</div>
</div></div>
Mark Shanks | 16 Apr 02:33 2015
Picon

[MarkLogic Dev General] Returning of averages rather than counts

Hi,

I've been going through the analytics tutorial at https://developer.marklogic.com/learn/rest/analytics. I have a custom search returning an average on a variable. However, what is frequently needed is to return the average of a variable across another variable/facet. The tutorial shows how to produce constraints/facets, but doesn't show how to return averages across the constraint/facet. I was hoping that by nesting the code, the appropriate average would be returned, but the server seems to just ignore the average request (see below). What am I doing wrong?

xdmp:document-insert("/Default/climate/rest-api/options/tutorial.xml",
  <search:options xmlns:search="http://marklogic.com/appservices/search"> 
    <search:constraint name="location">
    <search:range type="xs:string" facet="true" collation="http://marklogic.com/collation/">
      <search:element ns="http://data/" name="LOCATION_ID"

      <search:values name="temperature">
          <search:range type="xs:int">
           <search:element ns="http://data/" name="TEMPERATURE_READING"/>
           </search:range>
         <search:aggregate apply="avg"/>
      </search:values>


      </search:element>
     </search:range>
  </search:constraint>
</search:options>
)

Thanks.
<div><div dir="ltr">Hi,<div><br></div>
<div>I've been going through the analytics tutorial at&nbsp;<a href="https://developer.marklogic.com/learn/rest/analytics" target="_blank">https://developer.marklogic.com/learn/rest/analytics</a>. I have a custom search returning an average on a variable. However, what is frequently needed is to return the average of a variable across another variable/facet. The tutorial shows how to produce constraints/facets, but doesn't show how to return averages across the constraint/facet. I was hoping that by nesting the code, the appropriate average would be returned, but the server seems to just ignore the average request (see below). What am I doing wrong?</div>
<div><br></div>
<div>
<div>xdmp:document-insert("/Default/climate/rest-api/options/tutorial.xml",</div>
<div>&nbsp; &lt;search:options xmlns:search="http://marklogic.com/appservices/search"&gt;&nbsp;</div>
<div>&nbsp; &nbsp; &lt;search:constraint name="location"&gt;</div>
<div>&nbsp; &nbsp; &lt;search:range type="xs:string" facet="true" collation="http://marklogic.com/collation/"&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &lt;search:element ns="http://data/" name="LOCATION_ID"</div>
<div><br></div>
<div>&nbsp; &nbsp; &nbsp; &lt;search:values name="temperature"&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;search:range type="xs:int"&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;search:element ns="http://data/" name="TEMPERATURE_READING"/&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/search:range&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;search:aggregate apply="avg"/&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &lt;/search:values&gt;</div>
<div><br></div>
<div><br></div>
<div>&nbsp; &nbsp; &nbsp; &lt;/search:element&gt;</div>
<div>&nbsp; &nbsp; &nbsp;&lt;/search:range&gt;</div>
<div>&nbsp; &lt;/search:constraint&gt;</div>
<div>&lt;/search:options&gt;</div>
<div>)</div>
</div>
<div><br></div>
<div>Thanks.</div> 		 	   		  </div></div>
Shashidhar Rao | 14 Apr 23:53 2015
Picon

[MarkLogic Dev General] MLCP loading database or database rest modules

Hi,

I am confused whether to load data into database or database rest modules .
When you create xdbc server there is a drop down from where you can load to database or to the database rest modules.

What's the difference?

We are using Marklogic 7.

Thanks
<div><div dir="ltr">
<div>
<div>
<div>
<div>
<div>Hi,<br><br>
</div>I am confused whether to load data into database or database rest modules .<br>
</div>When you create xdbc server there is a drop down from where you can load to database or to the database rest modules.<br><br>
</div>What's the difference?<br><br>
</div>We are using Marklogic 7.<br><br>
</div>Thanks<br>
</div></div>
Danny Sinang | 14 Apr 20:15 2015
Picon

[MarkLogic Dev General] Same prefix, different namespace URI

I noticed my queries weren't consistently returning the values for the "xlink:href" attribute.

On close inspection, I discovered some docs declared the "xlink" namespace like this : 
xlink="xlink"

while other docs declared them like this :

Normally, I just have one "declare namespace" statement at the top of my query. But having two possible definitions for the same prefix has got me stuck.

Any ideas on how to get around this ?

Regards,
Danny






<div><div dir="ltr">I noticed my queries weren't consistently returning the values for the "xlink:href" attribute.<div><br></div>
<div>On close inspection, I discovered some docs declared the "xlink" namespace like this :&nbsp;</div>
<blockquote><div>xlink="xlink"</div></blockquote>
<div><p class="">while other docs declared them like this :<br></p></div>
<blockquote><div><p class="">xlink="<a href="http://www.w3.org/1999/xlink" class="">http://www.w3.org/1999/xlink</a>"</p></div></blockquote>
<div>
<p class="">Normally, I just have one "declare namespace" statement at the top of my query. But having two possible definitions for the same prefix has got me stuck.</p>
<p class="">Any ideas on how to get around this ?</p>
<p class="">Regards,<br>Danny</p>
<p class=""><br></p>
<p class=""><br></p>
</div>
<div><br></div>
<div>
<br><div><br></div>
</div>
</div></div>
Julia Egoshina | 14 Apr 12:33 2015

[MarkLogic Dev General] cannot fetch ordered documents from specified collection using nodeJS

Hi,

I’ve got a problem with querying data using QBE from nodeJS.

The following code works fine. It returns data that fits my example from the specified collection.

var query = client.qb.where(
           client.qb.byExample(
               {
                   "isin": params.isin
               }
           )
       );

       client.queryCollection(
           config.MARKLOGIC_STATIC_COL_NAME,
           query
       ).result(
           function (docs) {
               if (docs.length >= 1) {
                   queryResults[queryResults.length] = docs[0];
                   FetchLastPrice(docs[0].sedol, 1);
               } else {
                   LogWrite('Unable to find static document for isin "' + params.isin + '"');
                   next(errResult);
               }
           },
           function (err) {
               LogWrite(JSON.stringify(err, null, 4));
               next(errResult);
           }
       );

Once I add an orderBy statement (highlighted) the REST service starts returning documents that fit my
example not only from the specified collection but from all collections in my database.

var query = client.qb.where(
           client.qb.byExample(
               {
                   "isin": params.isin
               }
           )
       ).orderBy(client.qb.sort('validStart', 'descending'));

       client.queryCollection(
           config.MARKLOGIC_STATIC_COL_NAME,
           query
       ).result(
           function (docs) {
               if (docs.length >= 1) {
                   queryResults[queryResults.length] = docs[0];
                   FetchLastPrice(docs[0].sedol, 1);
               } else {
                   LogWrite('Unable to find static document for isin "' + params.isin + '"');
                   next(errResult);
               }
           },
           function (err) {
               LogWrite(JSON.stringify(err, null, 4));
               next(errResult);
           }
       );

How can I fix it up?

_______________________________________________
General mailing list
General <at> developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general
Shashidhar Rao | 13 Apr 19:22 2015
Picon

[MarkLogic Dev General] mlcp stopped working after loading some documents

Hi ,

Could someone share some of the experiences of loading xml data through mlcp as it loaded partially.

Total no of docs : 2361822

Total no of forests - 4 (Merging policy default one)

Another one which is loaded from different folder about -1623444 xml files loaded only 7% and then restarted then it loaded till 46% of the total.(same database and same forests)

Initially I had this space problem but then created a symlink to /var/opt/Marklogic to /home/Marklogic , everything went fine then it stopped.


Now, I restarted mlcp and then it stops after saying 7% completed .

What needs to be done any configuration changes I am missing.

Thanks





<div><div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>Hi ,<br><br>
</div>Could someone share some of the experiences of loading xml data through mlcp as it loaded partially.<br><br>
</div>Total no of docs : 2361822<br><br>
</div>Total no of forests - 4 (Merging policy default one)<br><br>
</div>Another one which is loaded from different folder about -1623444 xml files loaded only 7% and then restarted then it loaded till 46% of the total.(same database and same forests)<br><br>
</div>Initially I had this space problem but then created a symlink to /var/opt/Marklogic to /home/Marklogic , everything went fine then it stopped.<br><br><br>
</div>Now, I restarted mlcp and then it stops after saying 7% completed .<br><br>
</div>What needs to be done any configuration changes I am missing.<br><br>
</div>Thanks<br><div><div>
<br><div>
<br><div><div>
<br><br><br>
</div></div>
</div>
</div></div>
</div></div>

Gmane