Re: [MarkLogic Dev General] Count of cts:element-values() not equal to number of element instances--what's going on?

2017-08-14 Thread Eliot Kimber
Using both cts:frequence and cts:count-aggregate I get numbers that are closer to the correct count but are short by about 200. What would account for the difference? Queries: let $profiles := collection($collection)/enrprof:profiling-instance/enrprof:enrichment/enrprof:evalResult/prof:* let

Re: [MarkLogic Dev General] Count of cts:element-values() not equal to number of element instances--what's going on?

2017-08-14 Thread Mary Holstege
That is overkill. The results you get out of cts:element-values have a frequency (accessible via cts:frequency). The cts: aggregates (e.g. cts:count, cts:sum) take the frequency into account. //Mary On Mon, 14 Aug 2017 11:42:07 -0700, Oleksii Segeda wrote: >

Re: [MarkLogic Dev General] Count of cts:element-values() not equal to number of element instances--what's going on?

2017-08-14 Thread Florent Georges
On 14 August 2017 at 20:30, Eliot Kimber wrote: Hi Eliot, > Returns 21219, making it clear that the range index is returning > distinct values, not all values. It makes sense in terms of how I > would expect a range index to be structured (a one-to-many mapping > for values to elements) but

Re: [MarkLogic Dev General] Count of cts:element-values() not equal to number of element instances--what's going on?

2017-08-14 Thread Christopher Hamlin
Does https://docs.marklogic.com/cts:frequency help? /ch ___ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general

Re: [MarkLogic Dev General] Tracking Spawned Tasks?

2017-08-14 Thread Eliot Kimber
That’s a good point about comments. I’ll try to add comments for things I found lacking and subsequently discover answers to. Cheers, E. -- Eliot Kimber http://contrext.com From: on behalf of Evan Lenz

[MarkLogic Dev General] Count of cts:element-values() not equal to number of element instances--what's going on?

2017-08-14 Thread Eliot Kimber
I have this query: let $durations := cts:element-values(xs:QName("prof:overall-elapsed"), (), "descending", cts:collection-query($collection)) And this query: let $overall-elapsed := $profiles/prof:metadata/prof:overall-elapsed Where there an element range index for

Re: [MarkLogic Dev General] Count of cts:element-values() not equal to number of element instances--what's going on?

2017-08-14 Thread Oleksii Segeda
Eliot, You can do something like this: cts:element-value-co-occurrences(xs:QName("prof:overall-elapsed"),xs:QName("xdmp:document")) if you have only one element per document. Best, Oleksii Segeda IT Analyst Information and Technology Solutions www.worldbank.org -Original

[MarkLogic Dev General] Optimizing XPath Equals Performance

2017-08-14 Thread Basavaraj Kalloli
Hi, We have been following up with our on going performance problems and we found that we are looking up a bunch of documents in Marklogic and then doing an XPath equals on each of them to find all the nodes that match a contributor, the query is: declare namespace npg=""; declare namespace

Re: [MarkLogic Dev General] Optimizing XPath Equals Performance

2017-08-14 Thread Erik Hennum
Hi, Basu: Instead of putting many articles and contributors in a single document and using XPath to extract the articles and contributors from the document, have you explored putting each entity in a separate document and relying on search to give you just the entities you need? (For those

Re: [MarkLogic Dev General] Tracking Spawned Tasks?

2017-08-14 Thread Eliot Kimber
Can you expand on this statement: “if it is used as a future via the result option, it is obligated to return the result.” I didn’t see anything about this in the ML 8 docs for xdmp:spawn() and it seems pretty important. One general comment I’ll make about the ML docs is that it seems to

Re: [MarkLogic Dev General] Tracking Spawned Tasks?

2017-08-14 Thread Eliot Kimber
I like using set-server-field: my requirement feels like just what server fields were intended for. Cheers, E. -- Eliot Kimber http://contrext.com On 8/14/17, 8:32 AM, "general-boun...@developer.marklogic.com on behalf of Erik Hennum"

Re: [MarkLogic Dev General] Tracking Spawned Tasks?

2017-08-14 Thread Erik Hennum
Hi, Eliot: xdmp:spawn() doesn't return an identifier because, if it is used as a future via the result option, it is obligated to return the result. The approach you sketch below -- passing in an identifier and writing tickets to a status database -- is pretty much what InfoStudio did. One

Re: [MarkLogic Dev General] Tracking Spawned Tasks?

2017-08-14 Thread Ron Hitchens
Proceed with caution when using server fields. They exist only on a single machine, they are not propagated across nodes in a cluster. If you have a cluster behind a load balancer (as most are) and you stash something in a server field to be checked later, the next request may be vectored to

Re: [MarkLogic Dev General] Tracking Spawned Tasks?

2017-08-14 Thread Erik Hennum
Hi, Eliot and Ron: The return option is explained with the rest of the options in the eval article: http://docs.marklogic.com/xdmp:eval The second example under spawn uses the promise: http://docs.marklogic.com/xdmp:spawn As Ron notes, the server field is only useful if the polling

Re: [MarkLogic Dev General] Tracking Spawned Tasks?

2017-08-14 Thread Evan Lenz
Hi Eliot, One nice thing about the MarkLogic documentation for functions is that you can add helpful comments yourself. I've seen others write "See also" comments and have done so myself from time to time. In general I've found the comments very helpful, even if it's a user getting their newbie