我正在使用MLCP(Marklogic内容泵)将内容从一个数据库复制到另一个数据库.在这个我使用-query_filter选项,它的值是一个cts:查询以XML序列化格式的一组cts:element-range-query包装在cts:and-query中:
<cts:and-query xmlns:cts="http://marklogic.com/cts">
<cts:element-range-query operator=">">
<cts:element xmlns:c="http://iddn.icis.com/ns/core">c:released-on</cts:element>
<cts:value xsi:type="xs:dateTime" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">2000-12-21T00:00:00Z</cts:value>
</cts:element-range-query>
<cts:element-range-query operator="<">
<cts:element xmlns:c="http://iddn.icis.com/ns/core">c:released-on</cts:element>
<cts:value xsi:type="xs:dateTime" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">2016-12-21T00:00:00Z</cts:value>
</cts:element-range-query>
</cts:and-query>
Run Code Online (Sandbox Code Playgroud)
现在,上面的查询在ML Qconsole上执行时返回有效结果,但是当传入MLCP的-query_filter选项时,它会给出错误"无效属性值字符"<'.
Marklogic和MLCP的版本是8.0-5.
在进一步深入研究这个问题时,我发现只有当运算符值小于'<'时才会出现问题.
注意:我已在数据库中为"已启动"元素配置了有效的范围索引.
我有一个xquery文件,返回超过2.2GB的文本数据.当我直接在浏览器(Chrome)中点击xquery文件时,它会加载所有文本数据.
但是当我尝试使用xdmp:http-post($url,$options)它调用该xquery文件时会抛出XDMP-TOOBIG错误.以下是痕迹.
XDMP-TOOBIG: xdmp:http-post("http://server:8278/services/getText...", <options xmlns="xdmp:http"><timeout>600000</timeout><authentication method="basic"><usernam...</options>) -- Document size exceeds text document size limit of 2048 megabytes
in /services/invoke.xqy, at 20:7 [1.0-ml]
$HTTP_CALL = <configurations xmlns:config="" xmlns=""><credentails><username>admin</username><password>admin</password...</configurations>
$userName = text{"admin"}
$password = text{"admin"}
$timeOut = text{"600000"}
$url = "http://server:8278/services/getText..."
$responseType = "text/plain"
$options = <options xmlns="xdmp:http"><timeout>600000</timeout><authentication method="basic"><usernam...</options>
$response = xdmp:http-post("http://server:8278/services/getText...", <options xmlns="xdmp:http"><timeout>600000</timeout><authentication method="basic"><usernam...</options>)
$set-reponse-type = ()
Run Code Online (Sandbox Code Playgroud)
我可以在我使用xdmp的文件中指定的任何限制:http-post或任何其他解决方案?
感谢帮助.
我想获得cts的结果:搜索数据基于cts:得分排序.我正在使用以下代码 -
(
if ($direction = "descending")
then
for $result in cts:search (...)
order by cts:score($result) descending
return $result/element()
else
for $result in cts:search (...)
order by cts:score($result) ascending
return $result/element()
)[$first-result to $last-result]
Run Code Online (Sandbox Code Playgroud)
当前代码的问题在于,在大数据集的情况下,它会产生XDMP-EXPNTREECACHEFULL错误.不能增加扩展树缓存的大小.所以我只需要在这部分做一些事情.建议请.
我有像-
<domain xmlns:c="http://example.com/ns/core" xmlns="http://example.com/ns/core">
<c:id>http://example.com/xyz/no-data</c:id>
</domain>
Run Code Online (Sandbox Code Playgroud)
我在MarkLogic使用JavaScript,并且要运行的元素值的查询上c:id。像这样-
cts.elementValueQuery(xs.QName("c:id"), "http://example.com/xyz/no-data")
Run Code Online (Sandbox Code Playgroud)
但是为此,我需要声明名称空间c。如果是xQuery,我们可以做这样的事情-
declare namespace c="http://example.com/ns/core";
Run Code Online (Sandbox Code Playgroud)
但是我无法获得如何在JavaScript中执行此操作。
我有一些xml文档,其结构如下:
<root>
<intro>...</intro>
...
<body>
<p>..................
some text CO<sub>2</sub>
.................. </p>
</body>
</root>
Run Code Online (Sandbox Code Playgroud)
现在我想用CO2短语搜索所有结果,并希望在搜索结果中获得上述类型的结果.为此,我使用此查询 -
cts:search
(fn:collection ("urn:iddn:collections:searchable"),
cts:element-query
(
fn:QName("http://iddn.icis.com/ns/fields","body"),
cts:word-query
(
"CO2",
("case-insensitive","diacritic-sensitive","punctuation-insensitive",
"whitespace-sensitive","unstemmed","unwildcarded","lang=en"),
1
)
)
,
("unfiltered", "score-logtfidf"),
0.0)
Run Code Online (Sandbox Code Playgroud)
但是使用这个我无法获得文档CO<sub>2</sub>.我只用简单的短语获取数据CO2.
如果我替换搜索短语,CO 2那么我只能使用CO<sub>2</sub>而不是使用CO2
我想获得两者的组合数据CO<sub>2</sub>和CO2搜索结果.
我可以<sub>通过任何方式忽略,还是有其他方法来解决这个问题?
我在MarkLogic 之间element-range-index和之间感到困惑field-range-index.
请在示例的帮助下解释差异.