Marklogic无法创建元素范围索引

Marklogic无法创建元素范围索引,marklogic,Marklogic,无法创建元素范围索引。 错误无效强制范围元素索引xmlns=”http://marklogic.com/xdmp/database">...... as元素(配置) 我在数据库中有超过1亿个文档需要索引“tr:ModifiedDate” 管理库围绕$config展开。您需要更新配置,然后保存配置,而不仅仅是一个索引定义。你会经常这样做。正确的做法如下: xquery version "1.0-ml"; import module namespace admin = "http://marklo

无法创建元素范围索引。 错误无效强制范围元素索引xmlns=”http://marklogic.com/xdmp/database">...... as元素(配置)

我在数据库中有超过1亿个文档需要索引“tr:ModifiedDate”


管理库围绕$config展开。您需要更新配置,然后保存配置,而不仅仅是一个索引定义。你会经常这样做。正确的做法如下:

xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin"
      at "/MarkLogic/admin.xqy";

let $config := admin:get-configuration()
let $dbid := xdmp:database("IAD")

let $rangespec := admin:database-range-element-index(
  "dateTime",                            
  "http://dvtech.com/mdra/record/tr",
  "ModifiedDate",       
  "http://marklogic.com/collation/",
  fn:false()
)

let $config := admin:database-add-range-element-index($config, $dbid, $rangespec)
return
  admin:save-configuration($config)
您可以通过对该函数的一次调用添加多个范围索引

我还想提到,有一些部署工具可以帮助将范围索引部署到MarkLogic中。一个很好的例子是


管理库围绕$config展开。您需要更新配置,然后保存配置,而不仅仅是一个索引定义。你会经常这样做。正确的做法如下:

xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin"
      at "/MarkLogic/admin.xqy";

let $config := admin:get-configuration()
let $dbid := xdmp:database("IAD")

let $rangespec := admin:database-range-element-index(
  "dateTime",                            
  "http://dvtech.com/mdra/record/tr",
  "ModifiedDate",       
  "http://marklogic.com/collation/",
  fn:false()
)

let $config := admin:database-add-range-element-index($config, $dbid, $rangespec)
return
  admin:save-configuration($config)
您可以通过对该函数的一次调用添加多个范围索引

我还想提到,有一些部署工具可以帮助将范围索引部署到MarkLogic中。一个很好的例子是


如果在创建元素范围索引期间关闭Qconsole浏览器,会发生什么情况?是Marklogic后端继续构建元素范围索引,直到完成索引或ir停止进程。我担心笔记本电脑会在午夜后自动关机。保存配置更改很快。数据库的重新索引速度较慢,但在后台进行。如果在创建元素范围索引期间关闭Qconsole浏览器,会发生什么情况?是Marklogic后端继续构建元素范围索引,直到完成索引或ir停止进程。我担心笔记本电脑会在午夜后自动关机。保存配置更改很快。数据库的重新索引速度较慢,但在后台进行。。
xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin"
      at "/MarkLogic/admin.xqy";

let $config := admin:get-configuration()
let $dbid := xdmp:database("IAD")

let $rangespec := admin:database-range-element-index(
  "dateTime",                            
  "http://dvtech.com/mdra/record/tr",
  "ModifiedDate",       
  "http://marklogic.com/collation/",
  fn:false()
)

let $config := admin:database-add-range-element-index($config, $dbid, $rangespec)
return
  admin:save-configuration($config)