gpt4 book ai didi

用于获取数据库重新索引状态的 Marklogic API

转载 作者:行者123 更新时间:2023-12-03 00:03:00 24 4
gpt4 key购买 nike

您好,请帮助我使用 marklogic API 获取数据库的重新索引状态。现在我们正在使用这样的东西:让 $forest-reports :=

            let $forest-reports :=
for $forest-id in xdmp:database-forests($db-id) return
xdmp:forest-counts($forest-id, "*")

return
fn:sum(
for $e in $forest-reports//*[fn:contains(fn:local-name(.), "reindex") and fn:contains(fn:local-name(.), "count")]
where xs:integer($e) gt 0
return xs:integer($e)
)
return
if ($forest-reports) then
<table>
<tr>
<td><b>Forest</b></td>
<td><b>Fragments to Reindex</b></td>
</tr>
{
<tr><td colspan="2"><b>{$forest-reports}</b></td></tr>

}

但有时这并没有给我们正确的状态。

请告诉我们我们是否遵循正确的方法。

最佳答案

使用 xdmp:forest-status() 怎么样? ,例如这样:

(
for $forest-id in xdmp:database-forests(xdmp:database())
return xdmp:forest-status($forest-id)//*:reindexing
) = fn:true()

呵呵!

关于用于获取数据库重新索引状态的 Marklogic API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29236020/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com