Created
December 11, 2020 14:41
-
-
Save ableasdale/64d11a957e166d8ac706699b162078b4 to your computer and use it in GitHub Desktop.
MarkLogic: Look up duplicate URIs using the URI Lexicon (for troubleshooting XDMP-DBDUPURI exceptions)
This file contains hidden or 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"; | |
(: | |
A Utility module to allow the detection of duplicate URIs for a given database | |
This can be used in any situation where XDMP-DBDUPURI messages are found in the ErrorLogs | |
URIs are sorted by frequency order so higher frequencies (e.g. > 1) indicate that the URI | |
has been found in more than one forest | |
This module requires the uri lexicon to be enabled on your database | |
:) | |
for $uri at $i in cts:uris ((), ('frequency-order', 'descending', 'document')) | |
let $freq := cts:frequency($uri) | |
where $freq > 1 | |
return ($uri||': '||$freq) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment