Loading TOC...

cts:directory-query

cts:directory-query(
   $uris as xs:string*,
   [$depth as xs:string?]
) as cts:directory-query

Summary

Returns a query matching documents in the directories with the given URIs.

Parameters
$uris One or more directory URIs.
$depth "1" for immediate children, "infinity" for all. If not supplied, depth is "1".

Usage Notes

The directory URI should always have a trailing slash.

Example

  cts:search(//function,
    cts:directory-query(("/reports/","/analysis/"),"1"))
  
  => .. a sequence of 'function' elements in any document 
     in the directory "/reports/" or the directory "/analysis/".

Example

cts:search(//function, cts:and-query(("repair", 
  cts:directory-query(("/reports/", "/analysis/"), "1"))))
  
  => .. relevance ordered sequence of 'function' elements in 
     any document that both contains the word "repair" and is
     in either the directory "/reports/" or in the directory 
     "/analysis/".

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.