hde*_*dew 1 marklogic marklogic-10
我是 MarkLogic 的新手。
我有 XML 文档
<?xml version="1.0" encoding="UTF-8"?>
<books xmlns="http://www.marklogic.com/ns/gs-books">
<book bookid="2">
<title>A Quick Path to an Application</title>
<author>
<last>Smith</last>
<first>James</first>
</author>
<publisher>Scribblers Press</publisher>
<isbn>1494-3930392-4</isbn>
<abstract>
This book describes in detail the power of how
to use Java to build powerful web applications
that are built on the MarkLogic Server platform.
</abstract>
</book>
</books>
Run Code Online (Sandbox Code Playgroud)
我该如何使用cts:element-values它呢?
这是我的尝试: cts:element-values(xs:QName("test"),"test")
它给了我这个错误:
[1.0-ml] XDMP-ELEMRIDXNOTFOUND: cts:element-values(fn:QName("","t"), "t") -- t collation=http://marklogic.com/collation 没有元素范围索引/ 坐标系=wgs84 [marklogic]
为了能够使用cts:element-values(),元素需要有相应的范围索引才能使用。
返回指定元素值词典中的值。值词典是使用范围索引来实现的;因此,该函数需要函数中指定的每个元素的元素范围索引。如果没有为每个指定元素配置范围索引,则会抛出异常。
因此,为了能够运行:cts:element-values(xs:QName("test"),"test")
您首先需要为“ test”元素创建一个字符串范围索引(并确保重新索引器已启用,并允许它完成使用该元素重新索引文档,以便构建词典)。
您可以在管理 UI中以编程方式配置 element-range-index admin:database-add-range-element-index(),如果您有ml-gradle项目,则可以将它们添加到数据库配置中。
| 归档时间: |
|
| 查看次数: |
298 次 |
| 最近记录: |