张晓博 | 6 Jul 04:19 2015

[MarkLogic Dev General] How can i get the query plan for FWLOR query statement?

The xquery is:
for $x in collection('test')/catalog/product
where $x/ <at> dept = 'WMN'
return $x;

I had created attribute range index on product/ <at> dept, I would like to know whether the query will use the range index when marklogic process it.
so i ues the xdmp:plan to get the query plan, but i only the error :
<error:code>
XDMP-UNSEARCHABLE
</error:code>
<error:name>
</error:name>
<error:xquery-version>
1.0-ml
</error:xquery-version>
<error:message>
Expression is unsearchable
</error:message>
.......

so how can i get the query plan for FWLOR query statement?
or how can i konw whether the query will use the range index when marklogic process it?


<div>
<div>
<div>The xquery is:</div>
<div>
<div>for $x in collection('test')/catalog/product</div>
<div>where&nbsp;<span>$x/ <at> dept = 'WMN'</span>
</div>
<div>return $x;</div>
</div>
<div><br></div>
<div>I had created attribute range index on&nbsp;<span>product/ <at> dept,&nbsp;</span>I would like to know whether the query will use the range index when marklogic process it.</div>
<div>so i ues the xdmp:plan to get the query plan, but i only the error :</div>
<div>
<div class="element" data-element-name="error:code" data-element-prefix="error" data-element-localname="code" data-element-namespace-uri="http://marklogic.com/xdmp/error">
<span class="toggle"></span><span class="element-open" tabindex="1">&lt;<span class="element-name" title="error:code (http://marklogic.com/xdmp/error)"><span class="namespace-prefix">error</span>:<span class="local-name">code</span></span><span class="element-meta"></span>&gt;</span><div class="element-value text"><div class="text">XDMP-UNSEARCHABLE</div></div>
<span class="element-close">&lt;/<span class="element-name">error:code</span>&gt;</span>
</div>
<div class="element" data-element-name="error:name" data-element-prefix="error" data-element-localname="name" data-element-namespace-uri="http://marklogic.com/xdmp/error">
<span class="toggle"></span><span class="element-open" tabindex="1">&lt;<span class="element-name" title="error:name (http://marklogic.com/xdmp/error)"><span class="namespace-prefix">error</span>:<span class="local-name">name</span></span><span class="element-meta"></span>&gt;</span><div class="element-value"></div>
<span class="element-close">&lt;/<span class="element-name">error:name</span>&gt;</span>
</div>
<div class="element" data-element-name="error:xquery-version" data-element-prefix="error" data-element-localname="xquery-version" data-element-namespace-uri="http://marklogic.com/xdmp/error">
<span class="toggle"></span><span class="element-open" tabindex="1">&lt;<span class="element-name" title="error:xquery-version (http://marklogic.com/xdmp/error)"><span class="namespace-prefix">error</span>:<span class="local-name">xquery-version</span></span><span class="element-meta"></span>&gt;</span><div class="element-value text"><div class="text">1.0-ml</div></div>
<span class="element-close">&lt;/<span class="element-name">error:xquery-version</span>&gt;</span>
</div>
<div class="element" data-element-name="error:message" data-element-prefix="error" data-element-localname="message" data-element-namespace-uri="http://marklogic.com/xdmp/error">
<span class="toggle"></span><span class="element-open" tabindex="1">&lt;<span class="element-name" title="error:message (http://marklogic.com/xdmp/error)"><span class="namespace-prefix">error</span>:<span class="local-name">message</span></span><span class="element-meta"></span>&gt;</span><div class="element-value text"><div class="text">Expression is unsearchable</div></div>
<span class="element-close">&lt;/<span class="element-name">error:message</span>&gt;</span>
</div>
</div>
<div class="element" data-element-name="error:message" data-element-prefix="error" data-element-localname="message" data-element-namespace-uri="http://marklogic.com/xdmp/error"><span class="element-close">.......</span></div>
<div class="element" data-element-name="error:message" data-element-prefix="error" data-element-localname="message" data-element-namespace-uri="http://marklogic.com/xdmp/error"><span class="element-close"><br></span></div>
<div class="element" data-element-name="error:message" data-element-prefix="error" data-element-localname="message" data-element-namespace-uri="http://marklogic.com/xdmp/error">
<span>so h</span><span>ow can i get the query plan for FWLOR query statement? </span>
</div>
<div class="element" data-element-name="error:message" data-element-prefix="error" data-element-localname="message" data-element-namespace-uri="http://marklogic.com/xdmp/error">
<span>or how can i konw </span><span>whether the query will use the range index when marklogic process it?</span>
</div>
</div>
<br><br><span title="neteasefooter"><span></span></span>
</div>
shruti kapoor | 5 Jul 11:22 2015
Picon

[MarkLogic Dev General] Reduce the query execution time for cts:value-tuples


Hi,

I have a cts:value-tuples() query which fetches the json array result. The query runs on aprroximately 3lac xmls and the result set contains about 30k elements in json array. 
It takes about 48sec to run this query.

Is there a way to reduce its execution time. 

I have used range indexes for references and even enabled "concurrent".
 
--

Regards, 
Shruti Kapoor

<div><div dir="ltr">
<br clear="all"><div>Hi,</div>
<div><br></div>
<div>I have a cts:value-tuples() query which fetches the json array result. The query runs on aprroximately 3lac xmls and the result set contains about 30k elements in json array.&nbsp;</div>
<div>It takes about 48sec to run this query.</div>
<div><br></div>
<div>Is there a way to reduce its execution time.&nbsp;<br>
</div>
<div><br></div>
<div>I have used range indexes for references and even enabled "concurrent".</div>
<div>&nbsp;</div>-- <br><div class="gmail_signature"><div dir="ltr"><div><p><span>Regards,&nbsp;<br></span><span>Shruti Kapoor</span></p></div></div></div>
</div></div>
Chunyu Cong | 3 Jul 22:02 2015
Picon

Re: [MarkLogic Dev General] General Digest, Vol 133, Issue 11

Hello,
Thanks for all the replies.
They are very helpful.
Chunyu

On 3 July 2015 at 20:00, <general-request-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org> wrote:
Send General mailing list submissions to
        general-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://developer.marklogic.com/mailman/listinfo/general
or, via email, send a message with subject or body 'help' to
        general-request-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org

You can reach the person managing the list at
        general-owner-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of General digest..."


Today's Topics:

   1. Re: rang index for string element (Christopher Hamlin)
   2. Re: rang index for string element (Erik Hennum)
   3. Re: rang index for string element (Florent Georges)


----------------------------------------------------------------------

Message: 1
Date: Fri, 3 Jul 2015 09:36:43 -0400
From: Christopher Hamlin <cbhamlin <at> gmail.com>
Subject: Re: [MarkLogic Dev General] rang index for string element
To: MarkLogic Developer Discussion <general-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org>
Message-ID:
        <CADX+0QyUW=W2FEAFAfB_n=VOYH=s4o5C7dJygJyBdE6BunKUnQ <at> mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Hi,

If you want to search for an element containing a particular string
value, you can use cts:element-value-query, and this requires no extra
indexing.  Element string values are also automatically indexed.
Inside MarkLogic Server is great for overall technical info like this:
 https://developer.marklogic.com/inside-marklogic.

You'd likely use a range index if you want to compare values (less
than, greater than), or return values (all string values for a certain
element), or return counts for values.

And, as Raja says, a more specific question can get a more specific answer.

=Chris

On Fri, Jul 3, 2015 at 9:08 AM, Chunyu Cong <congchunyu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hello,
>
> I understand Marklogic index words automatically.
> What happens if we add range index for the string element?
>
> Is that never needed?
> Or the range index could speed up searching on string?
>
> Thanks,
> Chunyu
>
> _______________________________________________
> General mailing list
> General <at> developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>


------------------------------

Message: 2
Date: Fri, 3 Jul 2015 13:43:14 +0000
From: Erik Hennum <Erik.Hennum-efBvD/aTHCF8UrSeD/g0lQ@public.gmane.org>
Subject: Re: [MarkLogic Dev General] rang index for string element
To: MarkLogic Developer Discussion <general-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org>
Message-ID:
        <DFDF2FD50BF5AA42ADAF93FF2E3CA185070E9298-SsyoCIcCTNn6zGnnHJT/GcGcT3rJv0700E9HWUfgJXw@public.gmane.org>
Content-Type: text/plain; charset="iso-8859-1"

Hi, Chunyu:

You should create a string range index to do any of the following:

*  document sort
*  value lookups with document or value frequency (ie, facets)
*  value projection in co-occurring tuples
*  lexical order comparison queries (as in somePropertyOrElement < "c")

You can also use a string range index for exact matching (instead of stemmed matching) or to speed up queries on a frequently-queried JSON property or XML element or attribute.

As with many things computational, there is a tradeoff -- in this case adding a little to the index time and to the memory requirements.


Hoping that helps,


Erik Hennum

________________________________
From: general-bounces-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org [general-bounces-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org] on behalf of Chunyu Cong [congchunyu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org]
Sent: Friday, July 03, 2015 6:08 AM
To: General-ld4jwAGwUXRXKVOp+u0EsQ@public.gmane.orgrklogic.com
Subject: [MarkLogic Dev General] rang index for string element

Hello,

I understand Marklogic index words automatically.
What happens if we add range index for the string element?

Is that never needed?
Or the range index could speed up searching on string?

Thanks,
Chunyu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20150703/6c13da6d/attachment-0001.html

------------------------------

Message: 3
Date: Fri, 3 Jul 2015 15:47:02 +0200
From: Florent Georges <lists <at> fgeorges.org>
Subject: Re: [MarkLogic Dev General] rang index for string element
To: MarkLogic Developer Discussion <general-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org>
Message-ID:
        <CADyR_r2dfms8Vf2VeCZmG7xZZkCcDC9_ovNsydtGyDeRhMUiRw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Content-Type: text/plain; charset=UTF-8

  Hi,

  Very, very basically, the universal index will index words and
co-occurrence between 2 different words.  Which let you search
efficiently (like searches you would do on Google, using phrases,
several words, different weights depending on the distance between the
words you search for, etc.)

  Range indexes index values.  A string range index will then be
useful for enumerations or elements that you will typically search for
exact matches.  Range indexes are ordered also, and let you order
results very efficiently.  A very common use case for range indexes
are facets.

  If you describe what you want to achieve, we can tell you more.

  Regards,

--
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/


On 3 July 2015 at 15:08, Chunyu Cong wrote:
> Hello,
>
> I understand Marklogic index words automatically.
> What happens if we add range index for the string element?
>
> Is that never needed?
> Or the range index could speed up searching on string?
>
> Thanks,
> Chunyu
>
> _______________________________________________
> General mailing list
> General <at> developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>


------------------------------

_______________________________________________
General mailing list
General-ld4jwAGwUXTgXEvjvSGRgA@public.gmane.orggic.com
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general


End of General Digest, Vol 133, Issue 11
****************************************

<div>
<div dir="ltr">Hello,<div>Thanks for all the replies.</div>
<div>They are very helpful.</div>
<div>Chunyu</div>
</div>
<div class="gmail_extra">
<br><div class="gmail_quote">On 3 July 2015 at 20:00,  <span dir="ltr">&lt;<a href="mailto:general-request@..." target="_blank">general-request@...</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">Send General mailing list submissions to<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:general@...om">general@...</a><br><br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.marklogic.com/mailman/listinfo/general" rel="noreferrer" target="_blank">http://developer.marklogic.com/mailman/listinfo/general</a><br>
or, via email, send a message with subject or body 'help' to<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:general-request@...klogic.com">general-request@...</a><br><br>
You can reach the person managing the list at<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:general-owner@...ogic.com">general-owner@...</a><br><br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of General digest..."<br><br><br>
Today's Topics:<br><br>
&nbsp; &nbsp;1. Re: rang index for string element (Christopher Hamlin)<br>
&nbsp; &nbsp;2. Re: rang index for string element (Erik Hennum)<br>
&nbsp; &nbsp;3. Re: rang index for string element (Florent Georges)<br><br><br>
----------------------------------------------------------------------<br><br>
Message: 1<br>
Date: Fri, 3 Jul 2015 09:36:43 -0400<br>
From: Christopher Hamlin &lt;<a href="mailto:cbhamlin@...">cbhamlin <at> gmail.com</a>&gt;<br>
Subject: Re: [MarkLogic Dev General] rang index for string element<br>
To: MarkLogic Developer Discussion &lt;<a href="mailto:general <at> developer.marklogic.com">general@...</a>&gt;<br>
Message-ID:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;CADX+0QyUW=W2FEAFAfB_n=VOYH=<a href="mailto:s4o5C7dJygJyBdE6BunKUnQ@...">s4o5C7dJygJyBdE6BunKUnQ <at> mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=UTF-8<br><br>
Hi,<br><br>
If you want to search for an element containing a particular string<br>
value, you can use cts:element-value-query, and this requires no extra<br>
indexing.&nbsp; Element string values are also automatically indexed.<br>
Inside MarkLogic Server is great for overall technical info like this:<br>
&nbsp;<a href="https://developer.marklogic.com/inside-marklogic" rel="noreferrer" target="_blank">https://developer.marklogic.com/inside-marklogic</a>.<br><br>
You'd likely use a range index if you want to compare values (less<br>
than, greater than), or return values (all string values for a certain<br>
element), or return counts for values.<br><br>
And, as Raja says, a more specific question can get a more specific answer.<br><br>
=Chris<br><br>
On Fri, Jul 3, 2015 at 9:08 AM, Chunyu Cong &lt;<a href="mailto:congchunyu <at> gmail.com">congchunyu@...</a>&gt; wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; I understand Marklogic index words automatically.<br>
&gt; What happens if we add range index for the string element?<br>
&gt;<br>
&gt; Is that never needed?<br>
&gt; Or the range index could speed up searching on string?<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Chunyu<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; General mailing list<br>
&gt; <a href="mailto:General@...">General <at> developer.marklogic.com</a><br>
&gt; Manage your subscription at:<br>
&gt; <a href="http://developer.marklogic.com/mailman/listinfo/general" rel="noreferrer" target="_blank">http://developer.marklogic.com/mailman/listinfo/general</a><br>
&gt;<br><br><br>
------------------------------<br><br>
Message: 2<br>
Date: Fri, 3 Jul 2015 13:43:14 +0000<br>
From: Erik Hennum &lt;<a href="mailto:Erik.Hennum@...">Erik.Hennum@...</a>&gt;<br>
Subject: Re: [MarkLogic Dev General] rang index for string element<br>
To: MarkLogic Developer Discussion &lt;<a href="mailto:general <at> developer.marklogic.com">general@...</a>&gt;<br>
Message-ID:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;<a href="mailto:DFDF2FD50BF5AA42ADAF93FF2E3CA185070E9298@...">DFDF2FD50BF5AA42ADAF93FF2E3CA185070E9298@...</a>&gt;<br>
Content-Type: text/plain; charset="iso-8859-1"<br><br>
Hi, Chunyu:<br><br>
You should create a string range index to do any of the following:<br><br>
*&nbsp; document sort<br>
*&nbsp; value lookups with document or value frequency (ie, facets)<br>
*&nbsp; value projection in co-occurring tuples<br>
*&nbsp; lexical order comparison queries (as in somePropertyOrElement &lt; "c")<br><br>
You can also use a string range index for exact matching (instead of stemmed matching) or to speed up queries on a frequently-queried JSON property or XML element or attribute.<br><br>
As with many things computational, there is a tradeoff -- in this case adding a little to the index time and to the memory requirements.<br><br><br>
Hoping that helps,<br><br><br>
Erik Hennum<br><br>
________________________________<br>
From: <a href="mailto:general-bounces@...">general-bounces@...</a> [<a href="mailto:general-bounces <at> developer.marklogic.com">general-bounces@...</a>] on behalf of Chunyu Cong [<a href="mailto:congchunyu@...">congchunyu@...</a>]<br>
Sent: Friday, July 03, 2015 6:08 AM<br>
To: <a href="mailto:General@...">General@...rklogic.com</a><br>
Subject: [MarkLogic Dev General] rang index for string element<br><br>
Hello,<br><br>
I understand Marklogic index words automatically.<br>
What happens if we add range index for the string element?<br><br>
Is that never needed?<br>
Or the range index could speed up searching on string?<br><br>
Thanks,<br>
Chunyu<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://developer.marklogic.com/pipermail/general/attachments/20150703/6c13da6d/attachment-0001.html" rel="noreferrer" target="_blank">http://developer.marklogic.com/pipermail/general/attachments/20150703/6c13da6d/attachment-0001.html</a><br><br>
------------------------------<br><br>
Message: 3<br>
Date: Fri, 3 Jul 2015 15:47:02 +0200<br>
From: Florent Georges &lt;<a href="mailto:lists@...">lists <at> fgeorges.org</a>&gt;<br>
Subject: Re: [MarkLogic Dev General] rang index for string element<br>
To: MarkLogic Developer Discussion &lt;<a href="mailto:general <at> developer.marklogic.com">general@...</a>&gt;<br>
Message-ID:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;<a href="mailto:CADyR_r2dfms8Vf2VeCZmG7xZZkCcDC9_ovNsydtGyDeRhMUiRw@...">CADyR_r2dfms8Vf2VeCZmG7xZZkCcDC9_ovNsydtGyDeRhMUiRw@...</a>&gt;<br>
Content-Type: text/plain; charset=UTF-8<br><br>
&nbsp; Hi,<br><br>
&nbsp; Very, very basically, the universal index will index words and<br>
co-occurrence between 2 different words.&nbsp; Which let you search<br>
efficiently (like searches you would do on Google, using phrases,<br>
several words, different weights depending on the distance between the<br>
words you search for, etc.)<br><br>
&nbsp; Range indexes index values.&nbsp; A string range index will then be<br>
useful for enumerations or elements that you will typically search for<br>
exact matches.&nbsp; Range indexes are ordered also, and let you order<br>
results very efficiently.&nbsp; A very common use case for range indexes<br>
are facets.<br><br>
&nbsp; If you describe what you want to achieve, we can tell you more.<br><br>
&nbsp; Regards,<br><br>
--<br>
Florent Georges<br><a href="http://fgeorges.org/" rel="noreferrer" target="_blank">http://fgeorges.org/</a><br><a href="http://h2oconsulting.be/" rel="noreferrer" target="_blank">http://h2oconsulting.be/</a><br><br><br>
On 3 July 2015 at 15:08, Chunyu Cong wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; I understand Marklogic index words automatically.<br>
&gt; What happens if we add range index for the string element?<br>
&gt;<br>
&gt; Is that never needed?<br>
&gt; Or the range index could speed up searching on string?<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Chunyu<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; General mailing list<br>
&gt; <a href="mailto:General@...">General <at> developer.marklogic.com</a><br>
&gt; Manage your subscription at:<br>
&gt; <a href="http://developer.marklogic.com/mailman/listinfo/general" rel="noreferrer" target="_blank">http://developer.marklogic.com/mailman/listinfo/general</a><br>
&gt;<br><br><br>
------------------------------<br><br>
_______________________________________________<br>
General mailing list<br><a href="mailto:General@...">General@...gic.com</a><br>
Manage your subscription at:<br><a href="http://developer.marklogic.com/mailman/listinfo/general" rel="noreferrer" target="_blank">http://developer.marklogic.com/mailman/listinfo/general</a><br><br><br>
End of General Digest, Vol 133, Issue 11<br>
****************************************<br>
</blockquote>
</div>
<br>
</div>
</div>
Chunyu Cong | 3 Jul 15:08 2015
Picon

[MarkLogic Dev General] rang index for string element

Hello,

I understand Marklogic index words automatically.
What happens if we add range index for the string element?

Is that never needed?
Or the range index could speed up searching on string?

Thanks,
Chunyu
<div><div dir="ltr">Hello,<div><br></div>
<div>I understand Marklogic index words automatically.</div>
<div>What happens if we add range index for the string element?</div>
<div><br></div>
<div>Is that never needed?</div>
<div>Or the range index could speed up searching on string?</div>
<div><br></div>
<div>Thanks,</div>
<div>Chunyu</div>
</div></div>
张晓博 | 2 Jul 11:59 2015

Re: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error

Assume that the query will return 10,000 nodes, use the query:
cts:search(collection()/patient/link/visit/lab_report[ <at> delete_flag = '0'],
  cts:and-query(
    (cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), ">=", xs:dateTime("2010-09-25T00:00:00.000")),
    cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "<=", xs:dateTime("2014-09-25T00:00:00.000")))))[1 to 100]

i will get 100 nodes of all result, if i want to get the next 100 nodes , can i use the bellow query ?

cts:search(collection()/patient/link/visit/lab_report[ <at> delete_flag = '0'],
  cts:and-query(
    (cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), ">=", xs:dateTime("2010-09-25T00:00:00.000")),
    cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "<=", xs:dateTime("2014-09-25T00:00:00.000")))))[100 to 200]

Or how can i get all of the 10,000 nodes while i use pagination concept to avoid " XDMP-EXPNTREECACHEFULL"?




>Today's Topics: > > 1. Re: XDMP-EXPNTREECACHEFULL error > (Rajamani.Marimuthu <at> cognizant.com) > > >---------------------------------------------------------------------- > >Message: 1 >Date: Thu, 2 Jul 2015 09:18:51 +0000 >From: <Rajamani.Marimuthu <at> cognizant.com> >Subject: Re: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error >To: <general <at> developer.marklogic.com> >Message-ID: > <122019794B1A814483856CD4D052882A01C4E2F4 <at> CTSINCHNSXMBU.cts.com> >Content-Type: text/plain; charset="us-ascii" > >Hi Zise, > > Always use pagination concept to avoid " XDMP-EXPNTREECACHEFULL". Your first query returns only the count of the total result, but the second query returns the actual content as result. So, use something start and end values to get your result like [show 1 to 100 results]. > >See the below query ... > > >cts:search(collection()/patient/link/visit/lab_report[ <at> delete_flag = '0'], > > cts:and-query( > > (cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), ">=", xs:dateTime("2010-09-25T00:00:00.000")), > cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "<=", xs:dateTime("2014-09-25T00:00:00.000")))))[1 to 10] > >Thanks and regards >Raja >>> > >From: general-bounces <at> developer.marklogic.com [mailto:general-bounces <at> developer.marklogic.com] On Behalf Of ??? >Sent: Thursday, July 02, 2015 2:24 PM >To: general <at> developer.marklogic.com >Subject: Re: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error > > >I had created range index on delete_flag and report_date, and i change my xquery to this: > >count(cts:search(collection('test')/patient/link/visit/lab_report[ <at> delete_flag = '0'], > > cts:and-query( > > (cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), ">=", xs:dateTime("2010-09-25T00:00:00.000")), > > cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "<=", xs:dateTime("2014-09-25T00:00:00.000")))))); > > > >and this query can work. > > > >but if i execute the follow xquery, MarkLogic still will throw an XDMP-EXPNTREECACHEFULL error: > >cts:search(collection()/patient/link/visit/lab_report[ <at> delete_flag = '0'], > > cts:and-query( > > (cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), ">=", xs:dateTime("2010-09-25T00:00:00.000")), > > cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "<=", xs:dateTime("2014-09-25T00:00:00.000"))))); > > > >the above xquery will return a very large resut set, in this case, what can i do to avoid the XDMP-EXPNTREECACHEFULL error > > > > > >> > >>Message: 1 > >>Date: Wed, 1 Jul 2015 10:58:24 +0530 > >>From: Indrajeet Verma <indrajeet.verma <at> gmail.com<mailto:indrajeet.verma <at> gmail.com>> > >>Subject: Re: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error > >>To: MarkLogic Developer Discussion <general <at> developer.marklogic.com<mailto:general <at> developer.marklogic.com>> > >>Message-ID: > >> <CAKwHAegeH70RO8wgqvMuv3JAqbCmV7U09gnXHNfXmFbV1OrvpA <at> mail.gmail.com<mailto:CAKwHAegeH70RO8wgqvMuv3JAqbCmV7U09gnXHNfXmFbV1OrvpA <at> mail.gmail.com>> > >>Content-Type: text/plain; charset="utf-8" > >> > >>In Addition of Asit response, > >> > >>You should go with cts:element-values() and you should create cts:and-query > >>and inside it cts:range-query for the dates and flag. > >> > >>Create range index for lab_report, report_date and delete_flag. > >> > >>Let me know if you want any help in creating query. > >> > >>Regards, > >>Indy > >> > >>On Wed, Jul 1, 2015 at 10:45 AM, Asit Nautiyal <asitnautiyal <at> outlook.com<mailto:asitnautiyal <at> outlook.com>> > >>wrote: > >> > >>> Hi Zise, > >>> > >>> By observing below code, it will hit performance for sure and that's why > >>> your are getting XDMP-EXPNTREECACHEFULL error. > >>> To avoid XDMP-EXPNTREECACHEFULL error you have to tune your code. Use > >>> cts:queries (like range queries and others) to get your result first and > >>> then you can use count. > >>> > >>> Please go through the below link : > >>> > >>> https://docs.marklogic.com/guide/performance > >>> > >>> > >>> Regards, > >>> Asit Nautiyal > >>> ------------------------------ > >>> Date: Wed, 1 Jul 2015 10:11:01 +0800 > >>> From: zisedeqing <at> 163.com<mailto:zisedeqing <at> 163.com> > >>> To: general <at> developer.marklogic.com<mailto:general <at> developer.marklogic.com> > >>> Subject: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error > >>> > >>> > >>> when i execute the following xquery , marklogic throw an > >>> XDMP-EXPNTREECACHEFULL error: > >>> count(for $i in collection('test')/patient/link/visit/lab_report > >>> where $i / <at> report_date >= '2010-09-25T00:00:00.000' and $i/ <at> report_date > >>> <= '2014-09-25T00:00:00.000' and $i/ <at> delete_flag = '0' > >>> return $i) > >>> > >>> I can not increase size of expanded tree cache, so what i can do to avoid > >>> the XDMP-EXPNTREECACHEFULL error while the query resturn the very large > >>> results > >>> > >>> > >>> > >>> _______________________________________________ General mailing list > >>> General <at> developer.marklogic.com<mailto:General <at> developer.marklogic.com> Manage your subscription at: > >>> http://developer.marklogic.com/mailman/listinfo/general > >>> > >>> _______________________________________________ > >>> General mailing list > >>> General <at> developer.marklogic.com<mailto:General <at> developer.marklogic.com> > >>> Manage your subscription at: > >>> http://developer.marklogic.com/mailman/listinfo/general > >>> > >>> > >>-------------- next part -------------- > >>An HTML attachment was scrubbed... > >>URL: http://developer.marklogic.com/pipermail/general/attachments/20150701/e5ad4c84/attachment-0001.html > >> > >>------------------------------ > >> > >>Message: 2 > >>Date: Wed, 1 Jul 2015 13:46:50 +0000 > >>From: Dave Cassel <Dave.Cassel <at> marklogic.com<mailto:Dave.Cassel <at> marklogic.com>> > >>Subject: Re: [MarkLogic Dev General] how to update the attribute of > >> nodes? > >>To: MarkLogic Developer Discussion <general <at> developer.marklogic.com<mailto:general <at> developer.marklogic.com>> > >>Message-ID: <D1B93D2E.CCA51%dave.cassel <at> marklogic.com<mailto:D1B93D2E.CCA51%dave.cassel <at> marklogic.com>> > >>Content-Type: text/plain; charset="us-ascii" > >> > >>To Asit's point, if you need to make an update like this across a large number of documents, take a look at Corb2<https://github.com/marklogic/corb2>. > >> > >>-- > >>Dave Cassel<http://davidcassel.net>, <at> dmcassel<https://twitter.com/dmcassel> > >>Technical Community Manager > >>MarkLogic Corporation<http://www.marklogic.com/> > >>http://developer.marklogic.com/ > >> > >> > >>From: Indrajeet Verma <indrajeet.verma <at> gmail.com<mailto:indrajeet.verma <at> gmail.com<mailto:indrajeet.verma <at> gmail.com%3cmailto:indrajeet.verma <at> gmail.com>>> > >>Reply-To: MarkLogic Developer Discussion <general <at> developer.marklogic.com<mailto:general <at> developer.marklogic.com<mailto:general <at> developer.marklogic.com%3cmailto:general <at> developer.marklogic.com>>> > >>Date: Wednesday, July 1, 2015 at 1:21 AM > >>To: MarkLogic Developer Discussion <general <at> developer.marklogic.com<mailto:general <at> developer.marklogic.com<mailto:general <at> developer.marklogic.com%3cmailto:general <at> developer.marklogic.com>>> > >>Subject: Re: [MarkLogic Dev General] how to update the attribute of nodes? > >> > >>Hi Zise, > >> > >>You can try below code as well, > >> > >>xdmp:node-replace(/catalog/product/name/ <at> language, attribute language {"chinese"}) > >> > >>Regards, > >>Indy > >> > >>On Wed, Jul 1, 2015 at 10:37 AM, Asit Nautiyal <asitnautiyal <at> outlook.com<mailto:asitnautiyal <at> outlook.com<mailto:asitnautiyal <at> outlook.com%3cmailto:asitnautiyal <at> outlook.com>>> wrote: > >>Hi Zise, > >> > >>There are various ways to do this simple task. Find the below sample code : > >> > >>let $doc := fn:doc("/xmlFile.xml") > >>let $oldNode := $doc/catalog/product/name[ <at> language="en"] > >>let $newNode := element {fn:local-name($oldNode)} { attribute language {"chinese"}, $oldNode/text()} > >> > >>return xdmp:node-replace($oldNode,$newNode) > >> > >>Above code will work as expected. But, if your database size is very huge and you want to perform such update on entire database then use cts:queries for better performance. > >> > >> > >>Regards, > >>Asit Nautiyal > >> > >>________________________________ > >>Date: Wed, 1 Jul 2015 11:50:02 +0800 > >>From: zisedeqing <at> 163.com<mailto:zisedeqing <at> 163.com<mailto:zisedeqing <at> 163.com%3cmailto:zisedeqing <at> 163.com>> > >>To: general <at> developer.marklogic.com<mailto:general <at> developer.marklogic.com<mailto:general <at> developer.marklogic.com%3cmailto:general <at> developer.marklogic.com>> > >>Subject: [MarkLogic Dev General] how to update the attribute of nodes? > >> > >> > >>the xml document is: > >><catalog> > >><productdept="ACC"> > >><number> > >>443 > >></number> > >><namelanguage="en"> > >>Deluxe Travel Bag > >></name> > >></product> > >></catalog> > >> > >>I want to update the attirbute language of node name to new value, after update operation, the name node is: > >><namelanguage="chinese"> > >>Deluxe Travel Bag > >></name> > >> > >>which function can do this in marklogic 8.0? > >> > >> > >> > >>_______________________________________________ General mailing list General <at> developer.marklogic.com<mailto:General <at> developer.marklogic.com<mailto:General <at> developer.marklogic.com%3cmailto:General <at> developer.marklogic.com>> Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general > >> > >>_______________________________________________ > >>General mailing list > >>General <at> developer.marklogic.com<mailto:General <at> developer.marklogic.com<mailto:General <at> developer.marklogic.com%3cmailto:General <at> developer.marklogic.com>> > >>Manage your subscription at: > >>http://developer.marklogic.com/mailman/listinfo/general > >> > >> > >>-------------- next part -------------- > >>An HTML attachment was scrubbed... > >>URL: http://developer.marklogic.com/pipermail/general/attachments/20150701/0322e450/attachment.html > >> > >>------------------------------ > >> > >>_______________________________________________ > >>General mailing list > >>General <at> developer.marklogic.com<mailto:General <at> developer.marklogic.com> > >>Manage your subscription at: > >>http://developer.marklogic.com/mailman/listinfo/general > >> > >> > >>End of General Digest, Vol 133, Issue 1 > >>*************************************** > >This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored. >-------------- next part -------------- >An HTML attachment was scrubbed... >URL: http://developer.marklogic.com/pipermail/general/attachments/20150702/9e3eb2b7/attachment.html > >------------------------------ > >_______________________________________________ >General mailing list >General <at> developer.marklogic.com >Manage your subscription at: >http://developer.marklogic.com/mailman/listinfo/general > > >End of General Digest, Vol 133, Issue 4 >***************************************


<div>
<div>
<div>Assume that the query will return 10,000 nodes, use the query:</div>
<div>
<div>cts:search(collection()/patient/link/visit/lab_report[ <at> delete_flag = '0'],</div>
<div>&nbsp; cts:and-query(</div>
<div>&nbsp; &nbsp; (cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "&gt;=", xs:dateTime("2010-09-25T00:00:00.000")),</div>
<div>&nbsp; &nbsp; cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "&lt;=", xs:dateTime("2014-09-25T00:00:00.000")))))[1 to 100]</div>
<div><br></div>
<div>i will get 100 nodes of all result, if i want to get the next 100 nodes , can i use the bellow query ?</div>
<div><br></div>
<div>
<div>cts:search(collection()/patient/link/visit/lab_report[ <at> delete_flag = '0'],</div>
<div>&nbsp; cts:and-query(</div>
<div>&nbsp; &nbsp; (cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "&gt;=", xs:dateTime("2010-09-25T00:00:00.000")),</div>
<div>&nbsp; &nbsp; cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "&lt;=", xs:dateTime("2014-09-25T00:00:00.000")))))[100 to 200]</div>
<div><br></div>
<div>Or how can i get all of the 10,000 nodes while i&nbsp;<span>use pagination concept to avoid  " XDMP-EXPNTREECACHEFULL"?</span>
</div>
</div>
</div>
<br><br><br><div></div>
<div></div>
<br>&gt;Today's Topics:
&gt;
&gt;   1. Re: XDMP-EXPNTREECACHEFULL error
&gt;      (Rajamani.Marimuthu <at> cognizant.com)
&gt;
&gt;
&gt;----------------------------------------------------------------------
&gt;
&gt;Message: 1
&gt;Date: Thu, 2 Jul 2015 09:18:51 +0000
&gt;From: &lt;Rajamani.Marimuthu <at> cognizant.com&gt;
&gt;Subject: Re: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error
&gt;To: &lt;general <at> developer.marklogic.com&gt;
&gt;Message-ID:
&gt;	&lt;122019794B1A814483856CD4D052882A01C4E2F4 <at> CTSINCHNSXMBU.cts.com&gt;
&gt;Content-Type: text/plain; charset="us-ascii"
&gt;
&gt;Hi Zise,
&gt;
&gt;  Always use pagination concept to avoid  " XDMP-EXPNTREECACHEFULL". Your first query returns only the count of the total result, but the second query returns the actual content as result. So, use something start and end values to get your result like [show 1 to 100 results].
&gt;
&gt;See the below query ...
&gt;
&gt;
&gt;cts:search(collection()/patient/link/visit/lab_report[ <at> delete_flag = '0'],
&gt;
&gt;  cts:and-query(
&gt;
&gt;    (cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "&gt;=", xs:dateTime("2010-09-25T00:00:00.000")),
&gt;    cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "&lt;=", xs:dateTime("2014-09-25T00:00:00.000")))))[1 to 10]
&gt;
&gt;Thanks and regards
&gt;Raja &gt;&gt;&gt;
&gt;
&gt;From: general-bounces <at> developer.marklogic.com [mailto:general-bounces <at> developer.marklogic.com] On Behalf Of ???
&gt;Sent: Thursday, July 02, 2015 2:24 PM
&gt;To: general <at> developer.marklogic.com
&gt;Subject: Re: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error
&gt;
&gt;
&gt;I had created range index on delete_flag and report_date, and i change my xquery to this:
&gt;
&gt;count(cts:search(collection('test')/patient/link/visit/lab_report[ <at> delete_flag = '0'],
&gt;
&gt;  cts:and-query(
&gt;
&gt;    (cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "&gt;=", xs:dateTime("2010-09-25T00:00:00.000")),
&gt;
&gt;    cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "&lt;=", xs:dateTime("2014-09-25T00:00:00.000"))))));
&gt;
&gt;
&gt;
&gt;and this query can work.
&gt;
&gt;
&gt;
&gt;but if i execute the follow xquery, MarkLogic still will throw an XDMP-EXPNTREECACHEFULL error:
&gt;
&gt;cts:search(collection()/patient/link/visit/lab_report[ <at> delete_flag = '0'],
&gt;
&gt;  cts:and-query(
&gt;
&gt;    (cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "&gt;=", xs:dateTime("2010-09-25T00:00:00.000")),
&gt;
&gt;    cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "&lt;=", xs:dateTime("2014-09-25T00:00:00.000")))));
&gt;
&gt;
&gt;
&gt;the above xquery will return a very large resut set, in this case, what can i do to avoid the  XDMP-EXPNTREECACHEFULL error
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;&gt;
&gt;
&gt;&gt;Message: 1
&gt;
&gt;&gt;Date: Wed, 1 Jul 2015 10:58:24 +0530
&gt;
&gt;&gt;From: Indrajeet Verma &lt;indrajeet.verma <at> gmail.com&lt;mailto:indrajeet.verma <at> gmail.com&gt;&gt;
&gt;
&gt;&gt;Subject: Re: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error
&gt;
&gt;&gt;To: MarkLogic Developer Discussion &lt;general <at> developer.marklogic.com&lt;mailto:general <at> developer.marklogic.com&gt;&gt;
&gt;
&gt;&gt;Message-ID:
&gt;
&gt;&gt;       &lt;CAKwHAegeH70RO8wgqvMuv3JAqbCmV7U09gnXHNfXmFbV1OrvpA <at> mail.gmail.com&lt;mailto:CAKwHAegeH70RO8wgqvMuv3JAqbCmV7U09gnXHNfXmFbV1OrvpA <at> mail.gmail.com&gt;&gt;
&gt;
&gt;&gt;Content-Type: text/plain; charset="utf-8"
&gt;
&gt;&gt;
&gt;
&gt;&gt;In Addition of Asit response,
&gt;
&gt;&gt;
&gt;
&gt;&gt;You should go with cts:element-values() and you should create cts:and-query
&gt;
&gt;&gt;and inside it cts:range-query for the dates and flag.
&gt;
&gt;&gt;
&gt;
&gt;&gt;Create range index for lab_report, report_date and delete_flag.
&gt;
&gt;&gt;
&gt;
&gt;&gt;Let me know if you want any help in creating query.
&gt;
&gt;&gt;
&gt;
&gt;&gt;Regards,
&gt;
&gt;&gt;Indy
&gt;
&gt;&gt;
&gt;
&gt;&gt;On Wed, Jul 1, 2015 at 10:45 AM, Asit Nautiyal &lt;asitnautiyal <at> outlook.com&lt;mailto:asitnautiyal <at> outlook.com&gt;&gt;
&gt;
&gt;&gt;wrote:
&gt;
&gt;&gt;
&gt;
&gt;&gt;&gt; Hi Zise,
&gt;
&gt;&gt;&gt;
&gt;
&gt;&gt;&gt; By observing below code, it will hit performance for sure and that's why
&gt;
&gt;&gt;&gt; your are getting XDMP-EXPNTREECACHEFULL error.
&gt;
&gt;&gt;&gt; To avoid XDMP-EXPNTREECACHEFULL error you have to tune your code. Use
&gt;
&gt;&gt;&gt; cts:queries (like range queries and others) to get your result first and
&gt;
&gt;&gt;&gt; then you can use count.
&gt;
&gt;&gt;&gt;
&gt;
&gt;&gt;&gt; Please go through the below link :
&gt;
&gt;&gt;&gt;
&gt;
&gt;&gt;&gt; https://docs.marklogic.com/guide/performance
&gt;
&gt;&gt;&gt;
&gt;
&gt;&gt;&gt;
&gt;
&gt;&gt;&gt; Regards,
&gt;
&gt;&gt;&gt; Asit Nautiyal
&gt;
&gt;&gt;&gt; ------------------------------
&gt;
&gt;&gt;&gt; Date: Wed, 1 Jul 2015 10:11:01 +0800
&gt;
&gt;&gt;&gt; From: zisedeqing <at> 163.com&lt;mailto:zisedeqing <at> 163.com&gt;
&gt;
&gt;&gt;&gt; To: general <at> developer.marklogic.com&lt;mailto:general <at> developer.marklogic.com&gt;
&gt;
&gt;&gt;&gt; Subject: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error
&gt;
&gt;&gt;&gt;
&gt;
&gt;&gt;&gt;
&gt;
&gt;&gt;&gt; when i execute the following xquery , marklogic throw an
&gt;
&gt;&gt;&gt; XDMP-EXPNTREECACHEFULL error:
&gt;
&gt;&gt;&gt; count(for $i in collection('test')/patient/link/visit/lab_report
&gt;
&gt;&gt;&gt; where $i / <at> report_date &gt;= '2010-09-25T00:00:00.000' and $i/ <at>  report_date
&gt;
&gt;&gt;&gt; &lt;= '2014-09-25T00:00:00.000' and $i/ <at> delete_flag = '0'
&gt;
&gt;&gt;&gt; return $i)
&gt;
&gt;&gt;&gt;
&gt;
&gt;&gt;&gt; I can not increase size of expanded tree cache, so what i can do to avoid
&gt;
&gt;&gt;&gt; the XDMP-EXPNTREECACHEFULL error while the query resturn the very large
&gt;
&gt;&gt;&gt; results
&gt;
&gt;&gt;&gt;
&gt;
&gt;&gt;&gt;
&gt;
&gt;&gt;&gt;
&gt;
&gt;&gt;&gt; _______________________________________________ General mailing list
&gt;
&gt;&gt;&gt; General <at> developer.marklogic.com&lt;mailto:General <at> developer.marklogic.com&gt; Manage your subscription at:
&gt;
&gt;&gt;&gt; http://developer.marklogic.com/mailman/listinfo/general
&gt;
&gt;&gt;&gt;
&gt;
&gt;&gt;&gt; _______________________________________________
&gt;
&gt;&gt;&gt; General mailing list
&gt;
&gt;&gt;&gt; General <at> developer.marklogic.com&lt;mailto:General <at> developer.marklogic.com&gt;
&gt;
&gt;&gt;&gt; Manage your subscription at:
&gt;
&gt;&gt;&gt; http://developer.marklogic.com/mailman/listinfo/general
&gt;
&gt;&gt;&gt;
&gt;
&gt;&gt;&gt;
&gt;
&gt;&gt;-------------- next part --------------
&gt;
&gt;&gt;An HTML attachment was scrubbed...
&gt;
&gt;&gt;URL: http://developer.marklogic.com/pipermail/general/attachments/20150701/e5ad4c84/attachment-0001.html
&gt;
&gt;&gt;
&gt;
&gt;&gt;------------------------------
&gt;
&gt;&gt;
&gt;
&gt;&gt;Message: 2
&gt;
&gt;&gt;Date: Wed, 1 Jul 2015 13:46:50 +0000
&gt;
&gt;&gt;From: Dave Cassel &lt;Dave.Cassel <at> marklogic.com&lt;mailto:Dave.Cassel <at> marklogic.com&gt;&gt;
&gt;
&gt;&gt;Subject: Re: [MarkLogic Dev General] how to update the attribute of
&gt;
&gt;&gt;       nodes?
&gt;
&gt;&gt;To: MarkLogic Developer Discussion &lt;general <at> developer.marklogic.com&lt;mailto:general <at> developer.marklogic.com&gt;&gt;
&gt;
&gt;&gt;Message-ID: &lt;D1B93D2E.CCA51%dave.cassel <at> marklogic.com&lt;mailto:D1B93D2E.CCA51%dave.cassel <at> marklogic.com&gt;&gt;
&gt;
&gt;&gt;Content-Type: text/plain; charset="us-ascii"
&gt;
&gt;&gt;
&gt;
&gt;&gt;To Asit's point, if you need to make an update like this across a large number of documents, take a look at Corb2&lt;https://github.com/marklogic/corb2&gt;.
&gt;
&gt;&gt;
&gt;
&gt;&gt;--
&gt;
&gt;&gt;Dave Cassel&lt;http://davidcassel.net&gt;,  <at> dmcassel&lt;https://twitter.com/dmcassel&gt;
&gt;
&gt;&gt;Technical Community Manager
&gt;
&gt;&gt;MarkLogic Corporation&lt;http://www.marklogic.com/&gt;
&gt;
&gt;&gt;http://developer.marklogic.com/
&gt;
&gt;&gt;
&gt;
&gt;&gt;
&gt;
&gt;&gt;From: Indrajeet Verma &lt;indrajeet.verma <at> gmail.com&lt;mailto:indrajeet.verma <at> gmail.com&lt;mailto:indrajeet.verma <at> gmail.com%3cmailto:indrajeet.verma <at> gmail.com&gt;&gt;&gt;
&gt;
&gt;&gt;Reply-To: MarkLogic Developer Discussion &lt;general <at> developer.marklogic.com&lt;mailto:general <at> developer.marklogic.com&lt;mailto:general <at> developer.marklogic.com%3cmailto:general <at> developer.marklogic.com&gt;&gt;&gt;
&gt;
&gt;&gt;Date: Wednesday, July 1, 2015 at 1:21 AM
&gt;
&gt;&gt;To: MarkLogic Developer Discussion &lt;general <at> developer.marklogic.com&lt;mailto:general <at> developer.marklogic.com&lt;mailto:general <at> developer.marklogic.com%3cmailto:general <at> developer.marklogic.com&gt;&gt;&gt;
&gt;
&gt;&gt;Subject: Re: [MarkLogic Dev General] how to update the attribute of nodes?
&gt;
&gt;&gt;
&gt;
&gt;&gt;Hi Zise,
&gt;
&gt;&gt;
&gt;
&gt;&gt;You can try below code as well,
&gt;
&gt;&gt;
&gt;
&gt;&gt;xdmp:node-replace(/catalog/product/name/ <at> language, attribute language {"chinese"})
&gt;
&gt;&gt;
&gt;
&gt;&gt;Regards,
&gt;
&gt;&gt;Indy
&gt;
&gt;&gt;
&gt;
&gt;&gt;On Wed, Jul 1, 2015 at 10:37 AM, Asit Nautiyal &lt;asitnautiyal <at> outlook.com&lt;mailto:asitnautiyal <at> outlook.com&lt;mailto:asitnautiyal <at> outlook.com%3cmailto:asitnautiyal <at> outlook.com&gt;&gt;&gt; wrote:
&gt;
&gt;&gt;Hi Zise,
&gt;
&gt;&gt;
&gt;
&gt;&gt;There are various ways to do this simple task. Find the below sample code :
&gt;
&gt;&gt;
&gt;
&gt;&gt;let $doc := fn:doc("/xmlFile.xml")
&gt;
&gt;&gt;let $oldNode := $doc/catalog/product/name[ <at> language="en"]
&gt;
&gt;&gt;let $newNode := element {fn:local-name($oldNode)} { attribute language {"chinese"}, $oldNode/text()}
&gt;
&gt;&gt;
&gt;
&gt;&gt;return xdmp:node-replace($oldNode,$newNode)
&gt;
&gt;&gt;
&gt;
&gt;&gt;Above code will work as expected. But, if your database size is very huge and you want to perform such update on entire database then use cts:queries for better performance.
&gt;
&gt;&gt;
&gt;
&gt;&gt;
&gt;
&gt;&gt;Regards,
&gt;
&gt;&gt;Asit Nautiyal
&gt;
&gt;&gt;
&gt;
&gt;&gt;________________________________
&gt;
&gt;&gt;Date: Wed, 1 Jul 2015 11:50:02 +0800
&gt;
&gt;&gt;From: zisedeqing <at> 163.com&lt;mailto:zisedeqing <at> 163.com&lt;mailto:zisedeqing <at> 163.com%3cmailto:zisedeqing <at> 163.com&gt;&gt;
&gt;
&gt;&gt;To: general <at> developer.marklogic.com&lt;mailto:general <at> developer.marklogic.com&lt;mailto:general <at> developer.marklogic.com%3cmailto:general <at> developer.marklogic.com&gt;&gt;
&gt;
&gt;&gt;Subject: [MarkLogic Dev General] how to update the attribute of nodes?
&gt;
&gt;&gt;
&gt;
&gt;&gt;
&gt;
&gt;&gt;the xml document is:
&gt;
&gt;&gt;&lt;catalog&gt;
&gt;
&gt;&gt;&lt;productdept="ACC"&gt;
&gt;
&gt;&gt;&lt;number&gt;
&gt;
&gt;&gt;443
&gt;
&gt;&gt;&lt;/number&gt;
&gt;
&gt;&gt;&lt;namelanguage="en"&gt;
&gt;
&gt;&gt;Deluxe Travel Bag
&gt;
&gt;&gt;&lt;/name&gt;
&gt;
&gt;&gt;&lt;/product&gt;
&gt;
&gt;&gt;&lt;/catalog&gt;
&gt;
&gt;&gt;
&gt;
&gt;&gt;I want to update the attirbute language of node name to new value, after update operation, the name node is:
&gt;
&gt;&gt;&lt;namelanguage="chinese"&gt;
&gt;
&gt;&gt;Deluxe Travel Bag
&gt;
&gt;&gt;&lt;/name&gt;
&gt;
&gt;&gt;
&gt;
&gt;&gt;which function can do this in marklogic 8.0?
&gt;
&gt;&gt;
&gt;
&gt;&gt;
&gt;
&gt;&gt;
&gt;
&gt;&gt;_______________________________________________ General mailing list General <at> developer.marklogic.com&lt;mailto:General <at> developer.marklogic.com&lt;mailto:General <at> developer.marklogic.com%3cmailto:General <at> developer.marklogic.com&gt;&gt; Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
&gt;
&gt;&gt;
&gt;
&gt;&gt;_______________________________________________
&gt;
&gt;&gt;General mailing list
&gt;
&gt;&gt;General <at> developer.marklogic.com&lt;mailto:General <at> developer.marklogic.com&lt;mailto:General <at> developer.marklogic.com%3cmailto:General <at> developer.marklogic.com&gt;&gt;
&gt;
&gt;&gt;Manage your subscription at:
&gt;
&gt;&gt;http://developer.marklogic.com/mailman/listinfo/general
&gt;
&gt;&gt;
&gt;
&gt;&gt;
&gt;
&gt;&gt;-------------- next part --------------
&gt;
&gt;&gt;An HTML attachment was scrubbed...
&gt;
&gt;&gt;URL: http://developer.marklogic.com/pipermail/general/attachments/20150701/0322e450/attachment.html
&gt;
&gt;&gt;
&gt;
&gt;&gt;------------------------------
&gt;
&gt;&gt;
&gt;
&gt;&gt;_______________________________________________
&gt;
&gt;&gt;General mailing list
&gt;
&gt;&gt;General <at> developer.marklogic.com&lt;mailto:General <at> developer.marklogic.com&gt;
&gt;
&gt;&gt;Manage your subscription at:
&gt;
&gt;&gt;http://developer.marklogic.com/mailman/listinfo/general
&gt;
&gt;&gt;
&gt;
&gt;&gt;
&gt;
&gt;&gt;End of General Digest, Vol 133, Issue 1
&gt;
&gt;&gt;***************************************
&gt;
&gt;This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored.
&gt;-------------- next part --------------
&gt;An HTML attachment was scrubbed...
&gt;URL: http://developer.marklogic.com/pipermail/general/attachments/20150702/9e3eb2b7/attachment.html 
&gt;
&gt;------------------------------
&gt;
&gt;_______________________________________________
&gt;General mailing list
&gt;General <at> developer.marklogic.com
&gt;Manage your subscription at: 
&gt;http://developer.marklogic.com/mailman/listinfo/general
&gt;
&gt;
&gt;End of General Digest, Vol 133, Issue 4
&gt;***************************************
</div>
<br><br><span title="neteasefooter"><span></span></span>
</div>
张晓博 | 2 Jul 10:53 2015

Re: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error

I had created range index on delete_flag and report_date, and i change my xquery to this:
count(cts:search(collection('test')/patient/link/visit/lab_report[ <at> delete_flag = '0'], cts:and-query( (cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), ">=", xs:dateTime("2010-09-25T00:00:00.000")), cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "<=", xs:dateTime("2014-09-25T00:00:00.000"))))));

and this query can work.

but if i execute the follow xquery, MarkLogic still will throw an XDMP-EXPNTREECACHEFULL error:
cts:search(collection()/patient/link/visit/lab_report[ <at> delete_flag = '0'],
cts:and-query( (cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), ">=", xs:dateTime("2010-09-25T00:00:00.000")),
cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "<=", xs:dateTime("2014-09-25T00:00:00.000")))));

the above xquery will return a very large resut set, in this case, what can i do to avoid the XDMP-EXPNTREECACHEFULL error


> >Message: 1 >Date: Wed, 1 Jul 2015 10:58:24 +0530 >From: Indrajeet Verma <indrajeet.verma <at> gmail.com> >Subject: Re: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error >To: MarkLogic Developer Discussion <general <at> developer.marklogic.com> >Message-ID: > <CAKwHAegeH70RO8wgqvMuv3JAqbCmV7U09gnXHNfXmFbV1OrvpA <at> mail.gmail.com> >Content-Type: text/plain; charset="utf-8" > >In Addition of Asit response, > >You should go with cts:element-values() and you should create cts:and-query >and inside it cts:range-query for the dates and flag. > >Create range index for lab_report, report_date and delete_flag. > >Let me know if you want any help in creating query. > >Regards, >Indy > >On Wed, Jul 1, 2015 at 10:45 AM, Asit Nautiyal <asitnautiyal <at> outlook.com> >wrote: > >> Hi Zise, >> >> By observing below code, it will hit performance for sure and that's why >> your are getting XDMP-EXPNTREECACHEFULL error. >> To avoid XDMP-EXPNTREECACHEFULL error you have to tune your code. Use >> cts:queries (like range queries and others) to get your result first and >> then you can use count. >> >> Please go through the below link : >> >> https://docs.marklogic.com/guide/performance >> >> >> Regards, >> Asit Nautiyal >> ------------------------------ >> Date: Wed, 1 Jul 2015 10:11:01 +0800 >> From: zisedeqing <at> 163.com >> To: general <at> developer.marklogic.com >> Subject: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error >> >> >> when i execute the following xquery , marklogic throw an >> XDMP-EXPNTREECACHEFULL error: >> count(for $i in collection('test')/patient/link/visit/lab_report >> where $i / <at> report_date >= '2010-09-25T00:00:00.000' and $i/ <at> report_date >> <= '2014-09-25T00:00:00.000' and $i/ <at> delete_flag = '0' >> return $i) >> >> I can not increase size of expanded tree cache, so what i can do to avoid >> the XDMP-EXPNTREECACHEFULL error while the query resturn the very large >> results >> >> >> >> _______________________________________________ General mailing list >> General <at> developer.marklogic.com Manage your subscription at: >> http://developer.marklogic.com/mailman/listinfo/general >> >> _______________________________________________ >> General mailing list >> General <at> developer.marklogic.com >> Manage your subscription at: >> http://developer.marklogic.com/mailman/listinfo/general >> >> >-------------- next part -------------- >An HTML attachment was scrubbed... >URL: http://developer.marklogic.com/pipermail/general/attachments/20150701/e5ad4c84/attachment-0001.html > >------------------------------ > >Message: 2 >Date: Wed, 1 Jul 2015 13:46:50 +0000 >From: Dave Cassel <Dave.Cassel <at> marklogic.com> >Subject: Re: [MarkLogic Dev General] how to update the attribute of > nodes? >To: MarkLogic Developer Discussion <general <at> developer.marklogic.com> >Message-ID: <D1B93D2E.CCA51%dave.cassel <at> marklogic.com> >Content-Type: text/plain; charset="us-ascii" > >To Asit's point, if you need to make an update like this across a large number of documents, take a look at Corb2<https://github.com/marklogic/corb2>. > >-- >Dave Cassel<http://davidcassel.net>, <at> dmcassel<https://twitter.com/dmcassel> >Technical Community Manager >MarkLogic Corporation<http://www.marklogic.com/> >http://developer.marklogic.com/ > > >From: Indrajeet Verma <indrajeet.verma <at> gmail.com<mailto:indrajeet.verma <at> gmail.com>> >Reply-To: MarkLogic Developer Discussion <general <at> developer.marklogic.com<mailto:general <at> developer.marklogic.com>> >Date: Wednesday, July 1, 2015 at 1:21 AM >To: MarkLogic Developer Discussion <general <at> developer.marklogic.com<mailto:general <at> developer.marklogic.com>> >Subject: Re: [MarkLogic Dev General] how to update the attribute of nodes? > >Hi Zise, > >You can try below code as well, > >xdmp:node-replace(/catalog/product/name/ <at> language, attribute language {"chinese"}) > >Regards, >Indy > >On Wed, Jul 1, 2015 at 10:37 AM, Asit Nautiyal <asitnautiyal <at> outlook.com<mailto:asitnautiyal <at> outlook.com>> wrote: >Hi Zise, > >There are various ways to do this simple task. Find the below sample code : > >let $doc := fn:doc("/xmlFile.xml") >let $oldNode := $doc/catalog/product/name[ <at> language="en"] >let $newNode := element {fn:local-name($oldNode)} { attribute language {"chinese"}, $oldNode/text()} > >return xdmp:node-replace($oldNode,$newNode) > >Above code will work as expected. But, if your database size is very huge and you want to perform such update on entire database then use cts:queries for better performance. > > >Regards, >Asit Nautiyal > >________________________________ >Date: Wed, 1 Jul 2015 11:50:02 +0800 >From: zisedeqing <at> 163.com<mailto:zisedeqing <at> 163.com> >To: general <at> developer.marklogic.com<mailto:general <at> developer.marklogic.com> >Subject: [MarkLogic Dev General] how to update the attribute of nodes? > > >the xml document is: ><catalog> ><productdept="ACC"> ><number> >443 ></number> ><namelanguage="en"> >Deluxe Travel Bag ></name> ></product> ></catalog> > >I want to update the attirbute language of node name to new value, after update operation, the name node is: ><namelanguage="chinese"> >Deluxe Travel Bag ></name> > >which function can do this in marklogic 8.0? > > > >_______________________________________________ General mailing list General <at> developer.marklogic.com<mailto:General <at> developer.marklogic.com> Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general > >_______________________________________________ >General mailing list >General <at> developer.marklogic.com<mailto:General <at> developer.marklogic.com> >Manage your subscription at: >http://developer.marklogic.com/mailman/listinfo/general > > >-------------- next part -------------- >An HTML attachment was scrubbed... >URL: http://developer.marklogic.com/pipermail/general/attachments/20150701/0322e450/attachment.html > >------------------------------ > >_______________________________________________ >General mailing list >General <at> developer.marklogic.com >Manage your subscription at: >http://developer.marklogic.com/mailman/listinfo/general > > >End of General Digest, Vol 133, Issue 1 >***************************************


<div>
<div>
<div>I had created range index on <span>delete_flag and </span>report_date, and i change my xquery to this:</div>
<div>count(cts:search(collection('test')/patient/link/visit/lab_report[ <at> delete_flag = '0'],
  cts:and-query(
    (cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "&gt;=", xs:dateTime("2010-09-25T00:00:00.000")),
    cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "&lt;=", xs:dateTime("2014-09-25T00:00:00.000"))))));</div>
<div><br></div>
<div>and this query can work.</div>
<div><br></div>
<div>but if i execute the follow xquery, MarkLogic still will throw an <span>XDMP-EXPNTREECACHEFULL error:</span>
</div>
<div><span>cts:search(collection()/patient/link/visit/lab_report[ <at> delete_flag = '0'],</span></div>
<span>  cts:and-query(
    (cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "&gt;=", xs:dateTime("2010-09-25T00:00:00.000")),
</span><div><span>    cts:element-attribute-range-query(xs:QName("lab_report"),xs:QName("report_date"), "&lt;=", xs:dateTime("2014-09-25T00:00:00.000")))));</span></div>
<div><span><br></span></div>
<div>
<span>the above xquery will return a very large resut set, in this case, what can i do to avoid the </span><span> </span><span>XDMP-EXPNTREECACHEFULL error</span>
</div>
<div><br></div>
<div><br></div>&gt;
&gt;Message: 1
&gt;Date: Wed, 1 Jul 2015 10:58:24 +0530
&gt;From: Indrajeet Verma &lt;indrajeet.verma <at> gmail.com&gt;
&gt;Subject: Re: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error
&gt;To: MarkLogic Developer Discussion &lt;general <at> developer.marklogic.com&gt;
&gt;Message-ID:
&gt;	&lt;CAKwHAegeH70RO8wgqvMuv3JAqbCmV7U09gnXHNfXmFbV1OrvpA <at> mail.gmail.com&gt;
&gt;Content-Type: text/plain; charset="utf-8"
&gt;
&gt;In Addition of Asit response,
&gt;
&gt;You should go with cts:element-values() and you should create cts:and-query
&gt;and inside it cts:range-query for the dates and flag.
&gt;
&gt;Create range index for lab_report, report_date and delete_flag.
&gt;
&gt;Let me know if you want any help in creating query.
&gt;
&gt;Regards,
&gt;Indy
&gt;
&gt;On Wed, Jul 1, 2015 at 10:45 AM, Asit Nautiyal &lt;asitnautiyal <at> outlook.com&gt;
&gt;wrote:
&gt;
&gt;&gt; Hi Zise,
&gt;&gt;
&gt;&gt; By observing below code, it will hit performance for sure and that's why
&gt;&gt; your are getting XDMP-EXPNTREECACHEFULL error.
&gt;&gt; To avoid XDMP-EXPNTREECACHEFULL error you have to tune your code. Use
&gt;&gt; cts:queries (like range queries and others) to get your result first and
&gt;&gt; then you can use count.
&gt;&gt;
&gt;&gt; Please go through the below link :
&gt;&gt;
&gt;&gt; https://docs.marklogic.com/guide/performance
&gt;&gt;
&gt;&gt;
&gt;&gt; Regards,
&gt;&gt; Asit Nautiyal
&gt;&gt; ------------------------------
&gt;&gt; Date: Wed, 1 Jul 2015 10:11:01 +0800
&gt;&gt; From: zisedeqing <at> 163.com
&gt;&gt; To: general <at> developer.marklogic.com
&gt;&gt; Subject: [MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error
&gt;&gt;
&gt;&gt;
&gt;&gt; when i execute the following xquery , marklogic throw an
&gt;&gt; XDMP-EXPNTREECACHEFULL error:
&gt;&gt; count(for $i in collection('test')/patient/link/visit/lab_report
&gt;&gt; where $i / <at> report_date &gt;= '2010-09-25T00:00:00.000' and $i/ <at>  report_date
&gt;&gt; &lt;= '2014-09-25T00:00:00.000' and $i/ <at> delete_flag = '0'
&gt;&gt; return $i)
&gt;&gt;
&gt;&gt; I can not increase size of expanded tree cache, so what i can do to avoid
&gt;&gt; the XDMP-EXPNTREECACHEFULL error while the query resturn the very large
&gt;&gt; results
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; _______________________________________________ General mailing list
&gt;&gt; General <at> developer.marklogic.com Manage your subscription at:
&gt;&gt; http://developer.marklogic.com/mailman/listinfo/general
&gt;&gt;
&gt;&gt; _______________________________________________
&gt;&gt; General mailing list
&gt;&gt; General <at> developer.marklogic.com
&gt;&gt; Manage your subscription at:
&gt;&gt; http://developer.marklogic.com/mailman/listinfo/general
&gt;&gt;
&gt;&gt;
&gt;-------------- next part --------------
&gt;An HTML attachment was scrubbed...
&gt;URL: http://developer.marklogic.com/pipermail/general/attachments/20150701/e5ad4c84/attachment-0001.html 
&gt;
&gt;------------------------------
&gt;
&gt;Message: 2
&gt;Date: Wed, 1 Jul 2015 13:46:50 +0000
&gt;From: Dave Cassel &lt;Dave.Cassel <at> marklogic.com&gt;
&gt;Subject: Re: [MarkLogic Dev General] how to update the attribute of
&gt;	nodes?
&gt;To: MarkLogic Developer Discussion &lt;general <at> developer.marklogic.com&gt;
&gt;Message-ID: &lt;D1B93D2E.CCA51%dave.cassel <at> marklogic.com&gt;
&gt;Content-Type: text/plain; charset="us-ascii"
&gt;
&gt;To Asit's point, if you need to make an update like this across a large number of documents, take a look at Corb2&lt;https://github.com/marklogic/corb2&gt;.
&gt;
&gt;--
&gt;Dave Cassel&lt;http://davidcassel.net&gt;,  <at> dmcassel&lt;https://twitter.com/dmcassel&gt;
&gt;Technical Community Manager
&gt;MarkLogic Corporation&lt;http://www.marklogic.com/&gt;
&gt;http://developer.marklogic.com/
&gt;
&gt;
&gt;From: Indrajeet Verma &lt;indrajeet.verma <at> gmail.com&lt;mailto:indrajeet.verma <at> gmail.com&gt;&gt;
&gt;Reply-To: MarkLogic Developer Discussion &lt;general <at> developer.marklogic.com&lt;mailto:general <at> developer.marklogic.com&gt;&gt;
&gt;Date: Wednesday, July 1, 2015 at 1:21 AM
&gt;To: MarkLogic Developer Discussion &lt;general <at> developer.marklogic.com&lt;mailto:general <at> developer.marklogic.com&gt;&gt;
&gt;Subject: Re: [MarkLogic Dev General] how to update the attribute of nodes?
&gt;
&gt;Hi Zise,
&gt;
&gt;You can try below code as well,
&gt;
&gt;xdmp:node-replace(/catalog/product/name/ <at> language, attribute language {"chinese"})
&gt;
&gt;Regards,
&gt;Indy
&gt;
&gt;On Wed, Jul 1, 2015 at 10:37 AM, Asit Nautiyal &lt;asitnautiyal <at> outlook.com&lt;mailto:asitnautiyal <at> outlook.com&gt;&gt; wrote:
&gt;Hi Zise,
&gt;
&gt;There are various ways to do this simple task. Find the below sample code :
&gt;
&gt;let $doc := fn:doc("/xmlFile.xml")
&gt;let $oldNode := $doc/catalog/product/name[ <at> language="en"]
&gt;let $newNode := element {fn:local-name($oldNode)} { attribute language {"chinese"}, $oldNode/text()}
&gt;
&gt;return xdmp:node-replace($oldNode,$newNode)
&gt;
&gt;Above code will work as expected. But, if your database size is very huge and you want to perform such update on entire database then use cts:queries for better performance.
&gt;
&gt;
&gt;Regards,
&gt;Asit Nautiyal
&gt;
&gt;________________________________
&gt;Date: Wed, 1 Jul 2015 11:50:02 +0800
&gt;From: zisedeqing <at> 163.com&lt;mailto:zisedeqing <at> 163.com&gt;
&gt;To: general <at> developer.marklogic.com&lt;mailto:general <at> developer.marklogic.com&gt;
&gt;Subject: [MarkLogic Dev General] how to update the attribute of nodes?
&gt;
&gt;
&gt;the xml document is:
&gt;&lt;catalog&gt;
&gt;&lt;productdept="ACC"&gt;
&gt;&lt;number&gt;
&gt;443
&gt;&lt;/number&gt;
&gt;&lt;namelanguage="en"&gt;
&gt;Deluxe Travel Bag
&gt;&lt;/name&gt;
&gt;&lt;/product&gt;
&gt;&lt;/catalog&gt;
&gt;
&gt;I want to update the attirbute language of node name to new value, after update operation, the name node is:
&gt;&lt;namelanguage="chinese"&gt;
&gt;Deluxe Travel Bag
&gt;&lt;/name&gt;
&gt;
&gt;which function can do this in marklogic 8.0?
&gt;
&gt;
&gt;
&gt;_______________________________________________ General mailing list General <at> developer.marklogic.com&lt;mailto:General <at> developer.marklogic.com&gt; Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
&gt;
&gt;_______________________________________________
&gt;General mailing list
&gt;General <at> developer.marklogic.com&lt;mailto:General <at> developer.marklogic.com&gt;
&gt;Manage your subscription at:
&gt;http://developer.marklogic.com/mailman/listinfo/general
&gt;
&gt;
&gt;-------------- next part --------------
&gt;An HTML attachment was scrubbed...
&gt;URL: http://developer.marklogic.com/pipermail/general/attachments/20150701/0322e450/attachment.html 
&gt;
&gt;------------------------------
&gt;
&gt;_______________________________________________
&gt;General mailing list
&gt;General <at> developer.marklogic.com
&gt;Manage your subscription at: 
&gt;http://developer.marklogic.com/mailman/listinfo/general
&gt;
&gt;
&gt;End of General Digest, Vol 133, Issue 1
&gt;***************************************
</div>
<br><br><span title="neteasefooter"><span></span></span>
</div>
张晓博 | 1 Jul 05:50 2015

[MarkLogic Dev General] how to update the attribute of nodes?

the xml document is:
<catalog>
<product dept="ACC">
<number>
443
</number>
<name language="en">
Deluxe Travel Bag
</name>
</product>
</catalog>

I want to update the attirbute language of node name to new value, after update operation, the name node is:
<name language="chinese">
Deluxe Travel Bag
</name>

which function can do this in marklogic 8.0?


<div>
<div>
<div>the xml document is:</div>
<div>
<span class="toggle"></span><span class="element-open" tabindex="1">&lt;<span class="element-name" title="catalog ()"><span class="local-name">catalog</span></span><span class="element-meta"></span>&gt;</span><div class="element-value"><div class="element" data-element-name="product" data-element-prefix="" data-element-localname="product" data-element-namespace-uri="">
<span class="toggle"></span><span class="element-open" tabindex="1">&lt;<span class="element-name" title="product ()"><span class="local-name">product</span></span><span class="element-meta"> <span class="attribute" title="dept ()" data-attribute-name="dept" data-attribute-localname="dept" data-attribute-prefix="" data-attribute-namespace-uri="" data-attribute-value="ACC"><span class="attribute-name"><span class="local-name">dept</span></span>="<span class="attribute-value">ACC</span>"</span></span>&gt;</span><div class="element-value">
<div class="element" data-element-name="number" data-element-prefix="" data-element-localname="number" data-element-namespace-uri="">
<span class="toggle"></span><span class="element-open" tabindex="1">&lt;<span class="element-name" title="number ()"><span class="local-name">number</span></span><span class="element-meta"></span>&gt;</span><div class="element-value text"><div class="text">443</div></div>
<span class="element-close">&lt;/<span class="element-name">number</span>&gt;</span>
</div>
<div class="element" data-element-name="name" data-element-prefix="" data-element-localname="name" data-element-namespace-uri="">
<span class="toggle"></span><span class="element-open" tabindex="1">&lt;<span class="element-name" title="name ()"><span class="local-name">name</span></span><span class="element-meta"> <span class="attribute" title="language ()" data-attribute-name="language" data-attribute-localname="language" data-attribute-prefix="" data-attribute-namespace-uri="" data-attribute-value="en"><span class="attribute-name"><span class="local-name">language</span></span>="<span class="attribute-value">en</span>"</span></span>&gt;</span><div class="element-value text"><div class="text">Deluxe Travel Bag</div></div>
<span class="element-close">&lt;/<span class="element-name">name</span>&gt;</span>
</div>
</div>
<span class="element-close">&lt;/<span class="element-name">product</span>&gt;</span>
</div></div>
<span class="element-close">&lt;/<span class="element-name">catalog</span>&gt;</span>
</div>
<div><span class="element-close"><br></span></div>
<div><span class="element-close">I want to update the attirbute <span>language </span>of node name to new value,  after update operation, the name node is:</span></div>
<div><span class="element-close"><span class="toggle"></span><span class="element-open" tabindex="1">&lt;<span class="element-name" title="name ()"><span class="local-name">name</span></span><span class="element-meta"> <span class="attribute" title="language ()" data-attribute-name="language" data-attribute-localname="language" data-attribute-prefix="" data-attribute-namespace-uri="" data-attribute-value="en"><span class="attribute-name"><span class="local-name">language</span></span>="<span class="attribute-value">chinese</span>"</span></span>&gt;</span><div class="element-value text"><div class="text">Deluxe Travel Bag</div></div>
<span class="element-close">&lt;/<span class="element-name">name</span>&gt;</span></span></div>
<div><span class="element-close"><span class="element-close"><br></span></span></div>
<div>which function can do this in marklogic 8.0?</div>
</div>
<br><br><span title="neteasefooter"><span></span></span>
</div>
张晓博 | 1 Jul 04:11 2015

[MarkLogic Dev General] XDMP-EXPNTREECACHEFULL error

when i execute the following xquery , marklogic throw an XDMP-EXPNTREECACHEFULL error:
count(for $i in collection('test')/patient/link/visit/lab_report 
where $i / <at> report_date >= '2010-09-25T00:00:00.000' and $i/ <at> report_date <= '2014-09-25T00:00:00.000' and $i/ <at> delete_flag = '0'
return $i)

I can not increase size of expanded tree cache, so what i can do to avoid the XDMP-EXPNTREECACHEFULL error while the query resturn the very large results


<div>
<div>
<div>when i execute the following xquery , marklogic throw an XDMP-EXPNTREECACHEFULL error:</div>
<div>count(for $i in collection('test')/patient/link/visit/lab_report&nbsp;</div>
<div>
<span>where&nbsp;</span><span>$i / <at> report_date &gt;= '2010-09-25T00:00:00.000'&nbsp;</span><span>and&nbsp;</span><span>$i/ <at>  report_date &lt;= '2014-09-25T00:00:00.000'&nbsp;</span><span>and&nbsp;</span><span>$i/ <at> delete_flag = '0'</span>
</div>
<div>return $i)</div>
<div><br></div>
<div>I can not increase size of expanded tree cache, so what i can do to avoid the&nbsp;<span>XDMP-EXPNTREECACHEFULL error while the query resturn the very large results</span>
</div>
</div>
<br><br><span title="neteasefooter"><span></span></span>
</div>
Paul M | 30 Jun 21:32 2015
Picon

[MarkLogic Dev General] xqsync odd error

New desktop machine. Wondering if anyone has encountered this error, since I have never.

INFO:setting up com.marklogic.ps.SimpleLogger <at> 3ee545fa for: com.marklogic.ps
INFO:XQSync starting: version 2012-08-27.0 on 1.7.0_79 (Java(TM) SE Runtime Environment)
INFO:XCC version = 5.0-6
INFO:setting up com.marklogic.ps.SimpleLogger <at> 3ee545fa for: com.marklogic.ps
INFO:Configuration is com.marklogic.ps.xqsync.Configuration
INFO:setting up com.marklogic.ps.SimpleLogger <at> 3ee545fa for: com.marklogic.ps
INFO:first-time setup
INFO:setting up com.marklogic.ps.SimpleLogger <at> 3ee545fa for: com.marklogic.ps
INFO:using OUTPUT_CONNECTION_STRING=xcc://...
INFO:using THREADS=4
INFO:using INPUT_PACKAGE=junk-001.zip
INFO:using SKIP_EXISTING=false
INFO:input from package: junk-001.zip
INFO:output to connection:
INFO:output connection string: 10....
INFO:XQSync starting: version 2012-08-27.0 on 1.7.0_79 (Java(TM) SE Runtime Environment)
INFO:XCC version = 5.0-6
INFO:starting pool of 4 threads, queue size = 100000
INFO:starting
INFO:output version info: client 5.0-6, server 5.0-6.1
SEVERE: sync failed for: ...
SEVERE: fatal error
com.marklogic.ps.xqsync.FatalException: com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.marklogic.xcc.DocumentFormat as it does not have a no-args constructor : Cannot construct com.marklogic.xcc.DocumentFormat as it does not have a no-args constructor
---- Debugging information ----
message             : Cannot construct com.marklogic.xcc.DocumentFormat as it does not have a no-args constructor
cause-exception     : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message       : Cannot construct com.marklogic.xcc.DocumentFormat as it does not have a no-args constructor
class               : com.marklogic.ps.xqsync.XQSyncDocumentMetadata
required-type       : com.marklogic.xcc.DocumentFormat
path                : /com.marklogic.ps.xqsync.XQSyncDocumentMetadata/format
line number         : 2
-------------------------------
    at com.marklogic.ps.xqsync.CallableSync.call(CallableSync.java:110)



Thank
-Paul
<div><div>
<div>New desktop machine. Wondering if anyone has encountered this error, since I have never. <br>
</div>
<div><br></div>
<div>INFO:setting up com.marklogic.ps.SimpleLogger <at> 3ee545fa for: com.marklogic.ps</div>INFO:XQSync starting: version 2012-08-27.0 on 1.7.0_79 (Java(TM) SE Runtime Environment)<br class="">INFO:XCC version = 5.0-6<br class="">INFO:setting up com.marklogic.ps.SimpleLogger <at> 3ee545fa for: com.marklogic.ps<br class="">INFO:Configuration is com.marklogic.ps.xqsync.Configuration<br class="">INFO:setting up com.marklogic.ps.SimpleLogger <at> 3ee545fa for: com.marklogic.ps<br class="">INFO:first-time setup<br class="">INFO:setting up com.marklogic.ps.SimpleLogger <at> 3ee545fa for: com.marklogic.ps<br class="">INFO:using OUTPUT_CONNECTION_STRING=xcc://...<br class="">INFO:using THREADS=4<br class="">INFO:using INPUT_PACKAGE=junk-001.zip<br class="">INFO:using SKIP_EXISTING=false<br class="">INFO:input from package: junk-001.zip<br class="">INFO:output to connection:<br class="">INFO:output connection string: 10....<br class="">INFO:XQSync starting: version 2012-08-27.0 on 1.7.0_79 (Java(TM) SE Runtime Environment)<br class="">INFO:XCC version = 5.0-6<br class="">INFO:starting pool of 4 threads, queue size = 100000<br class="">INFO:starting<br class="">INFO:output version info: client 5.0-6, server 5.0-6.1<br class="">SEVERE: sync failed for: ...<br class="">SEVERE: fatal error<br class="">com.marklogic.ps.xqsync.FatalException: com.thoughtworks.xstream.converters.ConversionException: Cannot construct com.marklogic.xcc.DocumentFormat as it does not have a no-args constructor : Cannot construct com.marklogic.xcc.DocumentFormat as it does not have a no-args constructor<br class="">---- Debugging information ----<br class="">message&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Cannot construct com.marklogic.xcc.DocumentFormat as it does not have a no-args constructor<br class="">cause-exception&nbsp;&nbsp;&nbsp;&nbsp; : com.thoughtworks.xstream.converters.reflection.ObjectAccessException<br class="">cause-message&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Cannot construct com.marklogic.xcc.DocumentFormat as it does not have a no-args constructor<br class="">class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : com.marklogic.ps.xqsync.XQSyncDocumentMetadata<br class="">required-type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : com.marklogic.xcc.DocumentFormat<br class="">path&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : /com.marklogic.ps.xqsync.XQSyncDocumentMetadata/format<br class="">line number&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 2<br class="">-------------------------------<br class=""><div dir="ltr">&nbsp;&nbsp; &nbsp;at com.marklogic.ps.xqsync.CallableSync.call(CallableSync.java:110)</div>
<div><br></div>
<div><br></div>
<div><br></div>
<div>Thank</div>
<div>-Paul<br>
</div>
</div></div>
Gary Larsen | 30 Jun 19:27 2015

[MarkLogic Dev General] Convert element text to node in XSL

Hope this isn’t too off topic.  In an XML document the value element contains and encoded XML string. I would like to parse this to a node in XSL for further processing.

<advancedSettings>
<value>&lt;settings&gt;&lt;setting name="asv.preview.maxRows"&gt;450&lt;/setting&gt;&lt;/settings&gt;</value>
</advancedSettings>

Is this possible?

Thanks,
Gary

 

<div><div class="WordSection1">
<p class="MsoNormal">Hope this isn&rsquo;t too off topic.&nbsp; In an XML document the value element contains and encoded XML string. I would like to parse this to a node in XSL for further processing.<br><br>&lt;advancedSettings&gt;<br>&lt;value&gt;&amp;lt;settings&amp;gt;&amp;lt;setting name="asv.preview.maxRows"&amp;gt;450&amp;lt;/setting&amp;gt;&amp;lt;/settings&amp;gt;&lt;/value&gt;<br>&lt;/advancedSettings&gt;<br><br>Is this possible?<br><br>Thanks,<br>Gary<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
</div></div>
Loredana Versienti | 29 Jun 16:51 2015
Picon

[MarkLogic Dev General] Install MarkLogik Server on Debian7

Hello,
I have a virtual machine with SO Debian 7, 64 bit and 3.2 kernel.
I wonder if it's possible to install MarkLogik Server.
Thank you very much
Best Loredana

Gmane