XDMP-ELEMRIDXNOTFOUND: cts:element-values——在MarkLogic 10 [Ma



我是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>

我如何使用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/coordinate-system=wgs84没有元素范围索引(marklogic)

为了能够使用cts:element-values(),元素需要有一个相应的范围索引来使用。

返回指定元素值字典中的值。值词典是使用范围索引实现的;因此这个函数需要一个元素为每个元素中指定范围指数函数。如果没有为每个指定元素配置范围索引,则抛出异常。

因此,为了能够运行:cts:element-values(xs:QName("test"),"test")

首先需要为"创建字符串范围索引。test";元素(并确保启用了驯鹿索引器,并允许它用该元素完成对文档的驯鹿索引,以便构建词典)

你可以在Admin UI中配置一个元素范围索引,用admin:database-add-range-element-index()编程,如果你有一个ml-gradle项目,它们可以添加到数据库配置中。

最新更新