Created
January 8, 2014 22:20
-
-
Save jmakeig/8325504 to your computer and use it in GitHub Desktop.
From a random sample of all documents in a MarkLogic database, returns a list of distinct paths to the leaf element whose local name matches a regular expression. You wouldn’t want to do this on the whole database because the XPath is very expensive.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
distinct-values( | |
cts:search(collection(), cts:and-query(()), ("unfiltered","score-random"))[1 to 100] | |
//*[matches(local-name(.), "Address$")]/xdmp:path(.) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment