Re: [MarkLogic Dev General] finding the number of occurences of an element in an xml

2016-11-18 Thread Geert Josten
If below doesn¹t perform well enough, try my doc-count UDF, which does effectively the same, but runs on D-nodes (where the data lives), instead on the E-node (where your code is executed): http://github-search.demo.marklogic.com/detail/grtjn/doc-count-udf.json Note: it requires URI lexicon, and

Re: [MarkLogic Dev General] finding the number of occurences of an element in an xml

2016-11-17 Thread Justin Makeig
The code below illustrates how you can calculate co-occurrences between an element and the URI of the documents that contain instances of that element. Then, for each URI it counts the total occurrences. Note, that you'll need to have the URI lexicon enabled and an element range index on x. Ju

[MarkLogic Dev General] finding the number of occurences of an element in an xml

2016-11-17 Thread Raghu
Hi All, I've got around 40 million XML documents out of which few documents are having an element say element x twice (they are supposed to have only one element x), I need to find the list of documents are there with multiple occurrences of that element x. what would be the ideal way to query the