John Zhong | 1 Dec 05:24 2011

[MarkLogic Dev General] List all collection names

Hi all,

I want to know if there any apis to return all the collection names in a database? I only can think out a stupid way:

let $collections := for $doc in fn:doc()
                           return xdmp:document-get-collections(fn:base-uri($doc))
return fn:distinct-values($collections)

Yes, I know those names are what I define before adding files into collections, but I just want to know if there is a way to do that.

Thank you,
John

<div><p>Hi all,<br><br>I want to know if there any apis to return all the collection names in a database? I only can think out a stupid way:<br><br>let $collections := for $doc in fn:doc()<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; return xdmp:document-get-collections(fn:base-uri($doc))<br>
return fn:distinct-values($collections)<br><br>Yes, I know those names are what I define before adding files into collections, but I just want to know if there is a way to do that.<br><br>Thank you,<br>John<br></p></div>
Michael Blakeley | 1 Dec 05:26 2011

Re: [MarkLogic Dev General] List all collection names

I expect you'll get a few copies of this link:

http://developer.marklogic.com/pubs/5.0/apidocs/Lexicons.html#cts:collections

> Returns values from the collection lexicon. This function requires the collection-lexicon database
configuration parameter to be enabled. If the collection-lexicon database-configuration parameter
is not enabled, an exception is thrown.

-- Mike

On 30 Nov 2011, at 20:24 , John Zhong wrote:

> Hi all,
> 
> I want to know if there any apis to return all the collection names in a database? I only can think out a stupid way:
> 
> let $collections := for $doc in fn:doc()
>                            return xdmp:document-get-collections(fn:base-uri($doc))
> return fn:distinct-values($collections)
> 
> Yes, I know those names are what I define before adding files into collections, but I just want to know if
there is a way to do that.
> 
> Thank you,
> John
> _______________________________________________
> General mailing list
> General@...
> http://developer.marklogic.com/mailman/listinfo/general

John Zhong | 1 Dec 05:32 2011

Re: [MarkLogic Dev General] List all collection names

ah, I forgot that. Thank you for reminding of me.

John

On Thu, Dec 1, 2011 at 12:26 PM, Michael Blakeley <mike-dWgsRPgt/GtWk0Htik3J/w@public.gmane.org> wrote:
I expect you'll get a few copies of this link:

http://developer.marklogic.com/pubs/5.0/apidocs/Lexicons.html#cts:collections

> Returns values from the collection lexicon. This function requires the collection-lexicon database configuration parameter to be enabled. If the collection-lexicon database-configuration parameter is not enabled, an exception is thrown.


-- Mike

On 30 Nov 2011, at 20:24 , John Zhong wrote:

> Hi all,
>
> I want to know if there any apis to return all the collection names in a database? I only can think out a stupid way:
>
> let $collections := for $doc in fn:doc()
>                            return xdmp:document-get-collections(fn:base-uri($doc))
> return fn:distinct-values($collections)
>
> Yes, I know those names are what I define before adding files into collections, but I just want to know if there is a way to do that.
>
> Thank you,
> John
> _______________________________________________
> General mailing list
> General <at> developer.marklogic.com
> http://developer.marklogic.com/mailman/listinfo/general

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

<div>
<p>ah, I forgot that. Thank you for reminding of me.<br><br>John<br><br></p>
<div class="gmail_quote">On Thu, Dec 1, 2011 at 12:26 PM, Michael Blakeley <span dir="ltr">&lt;<a href="mailto:mike@...">mike@...</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">I expect you'll get a few copies of this link:<br><br><a href="http://developer.marklogic.com/pubs/5.0/apidocs/Lexicons.html#cts:collections" target="_blank">http://developer.marklogic.com/pubs/5.0/apidocs/Lexicons.html#cts:collections</a><br><br>
&gt; Returns values from the collection lexicon. This function requires the collection-lexicon database configuration parameter to be enabled. If the collection-lexicon database-configuration parameter is not enabled, an exception is thrown.<br><br><br>
-- Mike<br><div>
<div></div>
<div class="h5">
<br>
On 30 Nov 2011, at 20:24 , John Zhong wrote:<br><br>
&gt; Hi all,<br>
&gt;<br>
&gt; I want to know if there any apis to return all the collection names in a database? I only can think out a stupid way:<br>
&gt;<br>
&gt; let $collections := for $doc in fn:doc()<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return xdmp:document-get-collections(fn:base-uri($doc))<br>
&gt; return fn:distinct-values($collections)<br>
&gt;<br>
&gt; Yes, I know those names are what I define before adding files into collections, but I just want to know if there is a way to do that.<br>
&gt;<br>
&gt; Thank you,<br>
&gt; John<br>
</div>
</div>&gt; _______________________________________________<br>
&gt; General mailing list<br>
&gt; <a href="mailto:General@...">General <at> developer.marklogic.com</a><br>
&gt; <a href="http://developer.marklogic.com/mailman/listinfo/general" target="_blank">http://developer.marklogic.com/mailman/listinfo/general</a><br><br>
_______________________________________________<br>
General mailing list<br><a href="mailto:General@...">General@...gic.com</a><br><a href="http://developer.marklogic.com/mailman/listinfo/general" target="_blank">http://developer.marklogic.com/mailman/listinfo/general</a><br>
</blockquote>
</div>
<br>
</div>
amit gope | 1 Dec 10:46 2011
Picon

[MarkLogic Dev General] Issue with Mark Logic Query

Hi All,

I have a database where the element range index is on the element date, and now i am executing a query where i have used element value query on one of the elements, but the results fetched are not adhering to the query, please suggest the changes that i need to make.

let $uri :=(cts:uris('', ('document','limit=1000000'),
            (cts:and-query((cts:directory-query('/content/', 'infinity'),
        cts:element-query((xs:QName('meta:DateLoaded')),'2011*'),
        cts:element-query((xs:QName('meta:PubName')),'Springer'),
            cts:element-query(xs:QName('Affiliation'), cts:and-query((), ())),
        cts:element-query(xs:QName('meta:Institution'),cts:and-query((),())),
        cts:not-query(cts:element-query(xs:QName("meta:GeoOrg"), cts:and-query((), ())))
              ), ())), (), ()))[1 to 1000000]
return (count($uri),$uri)


In the above query it is fetching me uri's of those articles where the meta dateloaded is 2010. Please suggest

--
Regards
Amit


<div><p>Hi All,<br><br>I have a database where the element range index is on the element date, and now i am executing a query where i have used element value query on one of the elements, but the results fetched are not adhering to the query, please suggest the changes that i need to make.<br><br>let $uri :=(cts:uris('', ('document','limit=1000000'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (cts:and-query((cts:directory-query('/content/', 'infinity'),<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cts:element-query((xs:QName('meta:DateLoaded')),'2011*'),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cts:element-query((xs:QName('meta:PubName')),'Springer'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cts:element-query(xs:QName('Affiliation'), cts:and-query((), ())),<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cts:element-query(xs:QName('meta:Institution'),cts:and-query((),())),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cts:not-query(cts:element-query(xs:QName("meta:GeoOrg"), cts:and-query((), ())))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ), ())), (), ()))[1 to 1000000]<br>return (count($uri),$uri)<br><br><br>In the above query it is fetching me uri's of those articles where the meta dateloaded is 2010. Please suggest<br clear="all"><br>-- <br>Regards<br>Amit <br><br><br></p></div>
Geert Josten | 1 Dec 12:47 2011
Picon

Re: [MarkLogic Dev General] Issue with Mark Logic Query

Hi Amit,

 

Can you give more details on how your content is structured? Most notably, can you tell whether multiple DateLoaded elements can occur within the same document?

 

Kind regards,

Geert

 

Van: general-bounces-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org [mailto:general-bounces-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org] Namens amit gope
Verzonden: donderdag 1 december 2011 10:47
Aan: general-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org
CC: rakesh.yadav12345-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Onderwerp: [MarkLogic Dev General] Issue with Mark Logic Query

 

Hi All,

I have a database where the element range index is on the element date, and now i am executing a query where i have used element value query on one of the elements, but the results fetched are not adhering to the query, please suggest the changes that i need to make.

let $uri :=(cts:uris('', ('document','limit=1000000'),
            (cts:and-query((cts:directory-query('/content/', 'infinity'),
        cts:element-query((xs:QName('meta:DateLoaded')),'2011*'),
        cts:element-query((xs:QName('meta:PubName')),'Springer'),
            cts:element-query(xs:QName('Affiliation'), cts:and-query((), ())),
        cts:element-query(xs:QName('meta:Institution'),cts:and-query((),())),
        cts:not-query(cts:element-query(xs:QName("meta:GeoOrg"), cts:and-query((), ())))
              ), ())), (), ()))[1 to 1000000]
return (count($uri),$uri)


In the above query it is fetching me uri's of those articles where the meta dateloaded is 2010. Please suggest

--
Regards
Amit

<div><div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi Amit,</span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>
<p class="MsoNormal"><span lang="EN-US">Can you give more details on how your content is structured? Most notably, can you tell whether multiple DateLoaded elements can occur within the same document?</span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>
<p class="MsoNormal"><span lang="EN-US">Kind regards,</span></p>
<p class="MsoNormal"><span lang="EN-US">Geert</span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>
<p class="MsoNormal"><span lang="EN-US">Van:</span><span lang="EN-US"> <a href="mailto:general-bounces@...com">general-bounces@...</a> [mailto:<a href="mailto:general-boun">general-boun</a></span><span><a href="mailto:ces <at> developer.marklogic.com">ces@...</a>] Namens amit gope<br>Verzonden: donderdag 1 december 2011 10:47<br>Aan: <a href="mailto:general@...">general@...</a><br>CC: <a href="mailto:rakesh.yadav12345@...">rakesh.yadav12345@...</a><br>Onderwerp: [MarkLogic Dev General] Issue with Mark Logic Query</span></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">Hi All,<br><br>I have a database where the element range index is on the element date, and now i am executing a query where i have used element value query on one of the elements, but the results fetched are not adhering to the query, please suggest the changes that i need to make.<br><br>let $uri :=(cts:uris('', ('document','limit=1000000'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (cts:and-query((cts:directory-query('/content/', 'infinity'),<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cts:element-query((xs:QName('meta:DateLoaded')),'2011*'),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cts:element-query((xs:QName('meta:PubName')),'Springer'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cts:element-query(xs:QName('Affiliation'), cts:and-query((), ())),<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cts:element-query(xs:QName('meta:Institution'),cts:and-query((),())),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cts:not-query(cts:element-query(xs:QName("meta:GeoOrg"), cts:and-query((), ())))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ), ())), (), ()))[1 to 1000000]<br>return (count($uri),$uri)<br><br><br>In the above query it is fetching me uri's of those articles where the meta dateloaded is 2010. Please suggest<br clear="all"><br>-- <br>Regards<br>Amit <br><br></p>
</div></div>
Gary Larsen | 1 Dec 13:33 2011

Re: [MarkLogic Dev General] ServerConnectionException

Thanks David

-----Original Message-----
From: general-bounces@...
[mailto:general-bounces@...] On Behalf Of Lee, David
Sent: Wednesday, November 30, 2011 5:02 PM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] ServerConnectionException

FYI I run with these options which tends to reduce the errors.
But still do check on the 0 length file. It through me totally (I didnt
possibly believe *I* would have zero length XML files ! The Horror !  but
yes that is what consistently caused my problem ... it just started one day
and kept going ... )

-- Java options which make GC more smooth ... 

java -cp $CLASSPATH -Xmx1024m -Xms256m -XX:+UseConcMarkSweepGC

----------------------------------------
David A. Lee
Senior Principal Software Engineer
Epocrates, Inc.
dlee@...
812-482-5224

-----Original Message-----
From: general-bounces@...
[mailto:general-bounces@...] On Behalf Of Gary Larsen
Sent: Wednesday, November 30, 2011 4:32 PM
To: 'General MarkLogic Developer Discussion'
Subject: Re: [MarkLogic Dev General] ServerConnectionException

Thanks Mike. This will be tough to reproduce, but I'll take a closer look at
the Java options.

-----Original Message-----
From: general-bounces@...
[mailto:general-bounces@...] On Behalf Of Michael
Blakeley
Sent: Wednesday, November 30, 2011 4:15 PM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] ServerConnectionException

It may be a timeout, possibly due to Java garbage collection. That can be a
problem with long-running Java processes.

You may be able to enable GC timing output to diagnose that. If you have
options for parallel or incremental GC, they may help.

-- Mike

On 30 Nov 2011, at 12:29 , Gary Larsen wrote:

> I have a Java XCC application which syncs the database with data from
another application.  This has been running for many weeks now without any
MarkLogic errors but recently ran into this:
>  
> com.marklogic.xcc.exceptions.ServerConnectionException: An established
connection was aborted by the software in your host machine
> [Session: user=Admin, cb=Netvisn [ContentSource: user=Admin, cb=Netvisn
[provider: address=server/137.136.22.61:8023, pool=0/64]]]
> [Client: XCC/4.2-2]
>                 at
com.marklogic.xcc.impl.handlers.AbstractRequestController.runRequest(Abstrac
tRequestController.java:116)
>                 at
com.marklogic.xcc.impl.SessionImpl.insertContent(SessionImpl.java:198)
>                 at
com.marklogic.xcc.impl.SessionImpl.insertContent(SessionImpl.java:226)
>                 at
com.envisn.nv.xmldb.MarkLogicHelper.storeFile(MarkLogicHelper.java:196)
> .
>                 at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja
va:886)
>                 at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9
08)
>                 at java.lang.Thread.run(Thread.java:662)
> Caused by: java.io.IOException: An established connection was aborted by
the software in your host machine
>  
>  
> The server did recover from this (though it blew up the sync process).
All the documents are loaded from files and a zero byte file should not be
possible. 
>  
> Does the exception suggest that the cause was a problem with the file
system, or something else?
>  
> Thanks,
> gary
> _______________________________________________
> General mailing list
> General@...
> http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
General@...
http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
General@...
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
General@...
http://developer.marklogic.com/mailman/listinfo/general

Geert Josten | 1 Dec 14:35 2011
Picon

Re: [MarkLogic Dev General] fyi: xquery repos activity on github

Can anyone make sense out of the sorting order of the ‘recently updated’ tab??

 

Grtz

 

Van: general-bounces <at> developer.marklogic.com [mailto:general-bounces-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org] Namens Eric Bloch
Verzonden: woensdag 30 november 2011 22:19
Aan: General MarkLogic Developer Discussion
Onderwerp: [MarkLogic Dev General] fyi: xquery repos activity on github

 

Every once in a while I check out https://github.com/languages/XQuery to see what I might have been missing wrt projects.

 

Below is some of the first tab of this page..

 

-Eric

 

 

 

Most Watched This Week

·        micheee / xquery-webapp-skeleton

·        LeoWoerteler / fots-basex

·        mblakele / xqut

·        LeoWoerteler / xquery-webapp-skeleton

·        jpcs / fots-basex

Most Forked This Week

·        micheee / xquery-webapp-skeleton

·        LeoWoerteler / fots-basex

Most Watched This Month

·        marklogic / Corona

·        mblakele / xqut

·        xquery / xquerydoc

·        mblakele / xqysp

·        marklogic / commons

Most Forked This Month

·        micheee / xquery-webapp-skeleton

·        marklogic / commons

·        LeoWoerteler / fots-basex

Most Watched Overall

·        marklogic / commons

·        xquery / xquerydoc

·        marklogic / Corona

·        marklogic / semantic

·        isubiker / mljson

Most Forked Overall

·        marklogic / commons

·        isubiker / mljson

·        opensiddur / opensiddur

·        ndw / ML-Schematron

·        micheee / xquery-webapp-skeleton

Recently Created Repositories more »

·        jpcs / fots-basex

·        LeoWoerteler / xquery-webapp-skeleton

·        robwhitby / commons

·        tvrhgn / sbg-synq

·        robwhitby / Trains

Recently Updated Repositories more »

·        marklogic / Corona

·        opensiddur / opensiddur

·        robwhitby / commons

·        tvrhgn / sbg-synq

·        xquery / xquerydoc

·         

<div><div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Can anyone make sense out of the sorting order of the &lsquo;recently updated&rsquo; tab??</span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>
<p class="MsoNormal"><span lang="EN-US">Grtz</span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>
<div><div>
<p class="MsoNormal"><span>Van:</span><span> <a href="mailto:general-bounces@...">general-bounces <at> developer.marklogic.com</a> [mailto:<a href="mailto:general-bounces@...rklogic.com">general-bounces@...</a>] Namens Eric Bloch<br>Verzonden: woensdag 30 november 2011 22:19<br>Aan: General MarkLogic Developer Discussion<br>Onderwerp: [MarkLogic Dev General] fyi: xquery repos activity on github</span></p>
</div></div>
<p class="MsoNormal">
&nbsp;</p>
<p class="MsoNormal">Every once in a while I check out&nbsp;<a href="https://github.com/languages/XQuery">https://github.com/languages/XQuery</a>&nbsp;to see what I might have been missing wrt projects.</p>
<div><p class="MsoNormal">
&nbsp;</p></div>
<div><p class="MsoNormal">Below is some of the first tab of this page..</p></div>
<div><p class="MsoNormal">&nbsp;</p></div>
<div><p class="MsoNormal">-Eric</p></div>
<div>
<p class="MsoNormal">&nbsp;</p>
<div><p class="MsoNormal">
&nbsp;</p></div>
<div><p class="MsoNormal">&nbsp;</p></div>
<div>
<div>
<h3><span>Most Watched This Week</span></h3>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/micheee"><span>micheee</span></a>&nbsp;/&nbsp;<a href="https://github.com/micheee/xquery-webapp-skeleton"><span>xquery-webapp-skeleton</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/LeoWoerteler"><span>LeoWoerteler</span></a>&nbsp;/&nbsp;<a href="https://github.com/LeoWoerteler/fots-basex"><span>fots-basex</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/mblakele"><span>mblakele</span></a>&nbsp;/&nbsp;<a href="https://github.com/mblakele/xqut"><span>xqut</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/LeoWoerteler"><span>LeoWoerteler</span></a>&nbsp;/&nbsp;<a href="https://github.com/LeoWoerteler/xquery-webapp-skeleton"><span>xquery-webapp-skeleton</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/jpcs"><span>jpcs</span></a>&nbsp;/&nbsp;<a href="https://github.com/jpcs/fots-basex"><span>fots-basex</span></a></span></p>
</div>
<div>
<h3><span>Most Forked This Week</span></h3>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/micheee"><span>micheee</span></a>&nbsp;/&nbsp;<a href="https://github.com/micheee/xquery-webapp-skeleton"><span>xquery-webapp-skeleton</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/LeoWoerteler"><span>LeoWoerteler</span></a>&nbsp;/&nbsp;<a href="https://github.com/LeoWoerteler/fots-basex"><span>fots-basex</span></a></span></p>
</div>
<div>
<h3><span>Most Watched This Month</span></h3>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/marklogic"><span>marklogic</span></a>&nbsp;/&nbsp;<a href="https://github.com/marklogic/Corona"><span>Corona</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/mblakele"><span>mblakele</span></a>&nbsp;/&nbsp;<a href="https://github.com/mblakele/xqut"><span>xqut</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/xquery"><span>xquery</span></a>&nbsp;/&nbsp;<a href="https://github.com/xquery/xquerydoc"><span>xquerydoc</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/mblakele"><span>mblakele</span></a>&nbsp;/&nbsp;<a href="https://github.com/mblakele/xqysp"><span>xqysp</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/marklogic"><span>marklogic</span></a>&nbsp;/&nbsp;<a href="https://github.com/marklogic/commons"><span>commons</span></a></span></p>
</div>
<div>
<h3><span>Most Forked This Month</span></h3>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/micheee"><span>micheee</span></a>&nbsp;/&nbsp;<a href="https://github.com/micheee/xquery-webapp-skeleton"><span>xquery-webapp-skeleton</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/marklogic"><span>marklogic</span></a>&nbsp;/&nbsp;<a href="https://github.com/marklogic/commons"><span>commons</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/LeoWoerteler"><span>LeoWoerteler</span></a>&nbsp;/&nbsp;<a href="https://github.com/LeoWoerteler/fots-basex"><span>fots-basex</span></a></span></p>
</div>
<div>
<h3><span>Most Watched Overall</span></h3>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/marklogic"><span>marklogic</span></a>&nbsp;/&nbsp;<a href="https://github.com/marklogic/commons"><span>commons</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/xquery"><span>xquery</span></a>&nbsp;/&nbsp;<a href="https://github.com/xquery/xquerydoc"><span>xquerydoc</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/marklogic"><span>marklogic</span></a>&nbsp;/&nbsp;<a href="https://github.com/marklogic/Corona"><span>Corona</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/marklogic"><span>marklogic</span></a>&nbsp;/&nbsp;<a href="https://github.com/marklogic/semantic"><span>semantic</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/isubiker"><span>isubiker</span></a>&nbsp;/&nbsp;<a href="https://github.com/isubiker/mljson"><span>mljson</span></a></span></p>
</div>
<div>
<h3><span>Most Forked Overall</span></h3>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/marklogic"><span>marklogic</span></a>&nbsp;/&nbsp;<a href="https://github.com/marklogic/commons"><span>commons</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/isubiker"><span>isubiker</span></a>&nbsp;/&nbsp;<a href="https://github.com/isubiker/mljson"><span>mljson</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/opensiddur"><span>opensiddur</span></a>&nbsp;/&nbsp;<a href="https://github.com/opensiddur/opensiddur"><span>opensiddur</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/ndw"><span>ndw</span></a>&nbsp;/&nbsp;<a href="https://github.com/ndw/ML-Schematron"><span>ML-Schematron</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/micheee"><span>micheee</span></a>&nbsp;/&nbsp;<a href="https://github.com/micheee/xquery-webapp-skeleton"><span>xquery-webapp-skeleton</span></a></span></p>
</div>
<div>
<h3><span>Recently Created Repositories&nbsp;<a href="https://github.com/languages/XQuery/created"><span>more &raquo;</span></a></span></h3>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/jpcs"><span>jpcs</span></a>&nbsp;/&nbsp;<a href="https://github.com/jpcs/fots-basex"><span>fots-basex</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/LeoWoerteler"><span>LeoWoerteler</span></a>&nbsp;/&nbsp;<a href="https://github.com/LeoWoerteler/xquery-webapp-skeleton"><span>xquery-webapp-skeleton</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/robwhitby"><span>robwhitby</span></a>&nbsp;/&nbsp;<a href="https://github.com/robwhitby/commons"><span>commons</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/tvrhgn"><span>tvrhgn</span></a>&nbsp;/&nbsp;<a href="https://github.com/tvrhgn/sbg-synq"><span>sbg-synq</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/robwhitby"><span>robwhitby</span></a>&nbsp;/&nbsp;<a href="https://github.com/robwhitby/Trains"><span>Trains</span></a></span></p>
</div>
<div>
<h3><span>Recently Updated Repositories&nbsp;<a href="https://github.com/languages/XQuery/updated"><span>more &raquo;</span></a></span></h3>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/marklogic"><span>marklogic</span></a>&nbsp;/&nbsp;<a href="https://github.com/marklogic/Corona"><span>Corona</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/opensiddur"><span>opensiddur</span></a>&nbsp;/&nbsp;<a href="https://github.com/opensiddur/opensiddur"><span>opensiddur</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/robwhitby"><span>robwhitby</span></a>&nbsp;/&nbsp;<a href="https://github.com/robwhitby/commons"><span>commons</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/tvrhgn"><span>tvrhgn</span></a>&nbsp;/&nbsp;<a href="https://github.com/tvrhgn/sbg-synq"><span>sbg-synq</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span></span><span><a href="https://github.com/xquery"><span>xquery</span></a>&nbsp;/&nbsp;<a href="https://github.com/xquery/xquerydoc"><span>xquerydoc</span></a></span></p>
<p class="MsoNormal"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>&nbsp;</span></p>
</div>
</div>
</div>
</div></div>
Michael Blakeley | 1 Dec 18:05 2011

Re: [MarkLogic Dev General] Issue with Mark Logic Query

To query the value of an element, use an element-value-query term like this:

  cts:element-value-query(xs:QName('meta:DateLoaded'), '2011*')

But since that uses a wildcard glob, it won't resolve from indexes unless you also have appropriate
wildcards enabled. If you have an element range index on meta:DateLoaded with type=date, it would
probably be better to specify a range instead of a wildcard:

  cts:element-range-query(xs:QName('meta:DateLoaded'), '>=', xs:date('2011-01-01')),
  cts:element-range-query(xs:QName('meta:DateLoaded'), '<', xs:date('2012-01-01'))

Finally, it may be faster to evaluate the entire cts:query using xdmp:estimate(cts:search($query))
rather than count(cts:uris($query)). Using count() will be O(n) with the number of results. Note that
both count and estimate support an optional limit argument, which might be useful for your '1 to 1000000' limit.

-- Mike

On 1 Dec 2011, at 01:46 , amit gope wrote:

> Hi All,
> 
> I have a database where the element range index is on the element date, and now i am executing a query where i
have used element value query on one of the elements, but the results fetched are not adhering to the query,
please suggest the changes that i need to make.
> 
> let $uri :=(cts:uris('', ('document','limit=1000000'),
>             (cts:and-query((cts:directory-query('/content/', 'infinity'),
>         cts:element-query((xs:QName('meta:DateLoaded')),'2011*'),
>         cts:element-query((xs:QName('meta:PubName')),'Springer'),
>             cts:element-query(xs:QName('Affiliation'), cts:and-query((), ())),
>         cts:element-query(xs:QName('meta:Institution'),cts:and-query((),())),
>         cts:not-query(cts:element-query(xs:QName("meta:GeoOrg"), cts:and-query((), ())))
>               ), ())), (), ()))[1 to 1000000]
> return (count($uri),$uri)
> 
> 
> In the above query it is fetching me uri's of those articles where the meta dateloaded is 2010. Please suggest
> 
> -- 
> Regards
> Amit 
> 
> 
> _______________________________________________
> General mailing list
> General@...
> http://developer.marklogic.com/mailman/listinfo/general

Mike Sokolov | 1 Dec 20:23 2011

[MarkLogic Dev General] large (?) number of range indexes

I've found that cts:element-values() is *much* faster when you don't use 
a query to filter.  For example,

cts:element-values (xs:QName("foo"), "a")

is 25x faster than

cts:element-values (xs:QName("foo"), "a", 
cts:element-value-query(xs:QName("bar"), "baz"))

when every document indexed by foo in fact has bar=baz, ie when the 
query is essentially a no-op.

Consequently, we're taking what used to be a bunch of large range 
indexes and breaking them up into a lot of smaller range indexes, each 
of which we can query independently (faster).

What I'm wondering is if anybody would care to speculate on whether 
having a large number of small(er) indexes will pose some other 
performance problem.  Presumably at least some of the keys will be 
shared across these indexes, but the values (the fragment/document 
references) should not, so overall storage should be only slightly larger?

--

-- 
Michael Sokolov
Engineering Director
www.ifactory.com

Jason Hunter | 1 Dec 21:42 2011

Re: [MarkLogic Dev General] large (?) number of range indexes

I think that'll work fine.

-jh-

On Dec 1, 2011, at 11:23 AM, Mike Sokolov wrote:

> I've found that cts:element-values() is *much* faster when you don't use 
> a query to filter.  For example,
> 
> cts:element-values (xs:QName("foo"), "a")
> 
> is 25x faster than
> 
> cts:element-values (xs:QName("foo"), "a", 
> cts:element-value-query(xs:QName("bar"), "baz"))
> 
> when every document indexed by foo in fact has bar=baz, ie when the 
> query is essentially a no-op.
> 
> Consequently, we're taking what used to be a bunch of large range 
> indexes and breaking them up into a lot of smaller range indexes, each 
> of which we can query independently (faster).
> 
> What I'm wondering is if anybody would care to speculate on whether 
> having a large number of small(er) indexes will pose some other 
> performance problem.  Presumably at least some of the keys will be 
> shared across these indexes, but the values (the fragment/document 
> references) should not, so overall storage should be only slightly larger?
> 
> -- 
> Michael Sokolov
> Engineering Director
> www.ifactory.com
> 
> _______________________________________________
> General mailing list
> General@...
> http://developer.marklogic.com/mailman/listinfo/general


Gmane