You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MarkLogic 10中使用xdmp:document-insert后托管文档丢失问题

DLS托管文档的插入、更新及修复测试记录

我最近做了一组关于MarkLogic DLS(文档生命周期管理)托管文档的测试,过程和结果如下:

1. 首次插入DLS托管文档

使用dls:document-insert-and-manage插入以下文档:

<scopedIntervention>
  <id>someId12345</id>
  <scopedInterventionName> First Name </scopedInterventionName>
  <forTestOnly> true </forTestOnly>
  <inactive> true </inactive>
</scopedIntervention>

结果:文档已插入并启用版本控制
通过以下查询语句验证:

cts:search(/scopedIntervention/id , dls:documents-query())

确认该文档存在于DLS最新文档集合中。

2. 使用xdmp:document-insert更新同URI文档

用以下内容更新同一个URI的文档:

<scopedIntervention>
  <id>someId12345</id>
  <scopedInterventionName> Updated Name </scopedInterventionName>
  <forTestOnly> true </forTestOnly>
  <inactive> true </inactive>
</scopedIntervention>

操作说明:使用xdmp:document-insert更新文档
再次用之前的查询语句验证:

cts:search(/scopedIntervention/id , dls:documents-query())

发现文档已从DLS最新版本集合中丢失。

3. 执行DLS升级步骤恢复文档

运行以下XQuery代码执行DLS升级操作:

xquery version "1.0-ml";
import module namespace dls = "http://marklogic.com/xdmp/dls" at "/MarkLogic/dls.xqy";
dls:set-upgrade-status(fn:false()),
dls:start-upgrade(),
fn:doc("http://marklogic.com/dls/upgrade-task-status.xml"),
dls:latest-validation-results(),
dls:set-upgrade-status(fn:true())

结果:执行完成后,文档重新出现在DLS最新版本集合列表中。

内容的提问来源于stack exchange,提问作者IAM

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.13 09:28:21