简体   繁体   中英

MarkLogic : how to use and-query in cts:uris?

I found explanations about cts:uris and there are two examples below.

What is difference between them. It seems that they will do the same job, but some say that the latter is better because it is faster.

Please give me a explanation, thank you in advance.

Eample 1:

cts:uris(@@@, (), cts:element-value-query(@@@@))

Example 2:

cts:uris((), (), 
  cts:and-query((
    cts:directory-query(@@@),
    cts:element-value-query(@@@@))))

The above examples are not the same. It is important to understand that the first argument is just a starting point for the values, but does not limit the end. If you pass in 'b', it will start with 'b*', but continue with 'c*', and beyond. This applies to all lexicon lookups, including cts:values and cts:collections .

If you need to get uris within a particular path, you are probably better off with cts:uri-match .

It is true though that passing in a directory-query as argument can improve performance. That also applies to cts:uri-match .

HTH!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM