Created
December 30, 2015 09:13
-
-
Save ableasdale/90e64e6a234e06f60391 to your computer and use it in GitHub Desktop.
Get unique term keys from xdmp:plan
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"; | |
| declare namespace qry="http://marklogic.com/cts/query"; | |
| declare variable $QUERY as cts:query := cts:word-query( ("one", "two") ); | |
| declare function local:get-keys($query as cts:query) as xs:unsignedLong* { | |
| fn:distinct-values(fn:data(xdmp:plan( cts:search(doc(), $QUERY ) )//qry:key)) | |
| }; | |
| local:get-keys($QUERY) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment