我不明白cts:search
和cts:element-attribute-values
之间的差异。 我可以用这两个函数得到相同的结果。 什么是最好的决心?cts:search和cts:element-attribute-values有什么区别?
cts:search(/t:ancestors-list/t:concept/t:concept-ancestor, cts:element-value-query(xs:QName("t:concept-ancestor"), $concept/id))/@subject
或
cts:element-attribute-values(
xs:QName("t:concept-ancestor"),
xs:QName("subject"),
(),
("collation=http://marklogic.com/collation/codepoint"),
cts:element-value-query(
xs:QName("t:concept-ancestor"),
$concept/id
)
)
AR:概念的祖先是元件范围索引和元素属性范围索引。
而且XML结构这样
<t:ancestors-list xmlns:ar="http://test.com">
<t:concept subject="http://test.com/concept#1c5cd7082ac908c62e9176770ae0fb53">
<t:concept-ancestor subject="http://test.com/concept#1c5cd7082ac908c62e9176770ae0fb53">4a1f650290103d39863bf7bc22ef18aa</t:concept-ancestor>
</t:concept>
<t:concept subject="http://test.com/concept#05b707457f79f42c93bf778915e4a589">
<t:concept-ancestor subject="http://test.com/concept#05b707457f79f42c93bf778915e4a589">4a1f650290103d39863bf7bc22ef18aa</t:concept-ancestor>
<t:concept-ancestor subject="http://test.com/concept#05b707457f79f42c93bf778915e4a589">1c5cd7082ac908c62e9176770ae0fb53</t:concept-ancestor>
</t:concept>
...
</t:ancestors-list>
谢谢!
构面是您可能想要其中一个cts的示例:* - values functions - 来自索引的值列表,可帮助用户浏览。 –
我可能是错的,但根据我的理解,如果有索引,'cts:element-value-query'会更加准确和快速。除此之外,不从数据库中检索节点,而是使用索引值而不是更高性能,并且缩放好得多。 – grtjn
'更准确'我的意思是关于xdmp:estimate .. – grtjn