Marklogic 如何将fn:start-with()和fn:end-with()与cts:uri()一起使用

Marklogic 如何将fn:start-with()和fn:end-with()与cts:uri()一起使用,marklogic,marklogic-9,Marklogic,Marklogic 9,我的要求是,仅当路径范围索引值以某个单词开头或结尾时,才返回文档URI 根据MarkLogic文档,我只能使用“>,您可以使用前导通配符和尾随通配符来查找以该值开头和结尾的所有值 然后在调用中与这些值一起使用 为什么不使用cts:urimatch(“*/some/path*”)?谢谢@bosari的回答。如果你看我的问题,我想在路径范围索引值上使用fn:start-with()和fn:ends-with(),而不是在uri上。你看了cts:value match了吗? let $path :=

我的要求是,仅当路径范围索引值以某个单词开头或结尾时,才返回文档URI

根据MarkLogic文档,我只能使用“>,您可以使用前导通配符和尾随通配符来查找以该值开头和结尾的所有值

然后在调用中与这些值一起使用


为什么不使用
cts:urimatch(“*/some/path*”)
?谢谢@bosari的回答。如果你看我的问题,我想在路径范围索引值上使用fn:start-with()和fn:ends-with(),而不是在uri上。你看了
cts:value match
了吗?
let $path := "/doc/foo";
let $word := "bar";
(: find the values that start with and end with the $word :)
let $values-starts-and-ends-with := (
  cts:value-match(cts:path-reference($path), $word||"*"), 
  cts:value-match(cts:path-reference($path), "*"||$word)
) 
(: use those values to find the URIs of docs with those values at that path :)
cts:uris("", (), cts:path-range-query($path, "=", $values-starts-and-ends-with))