Spring boot 如何从Flyway脚本在Marklogic中创建或验证ElementRangeIndexes

Spring boot 如何从Flyway脚本在Marklogic中创建或验证ElementRangeIndexes,spring-boot,marklogic,Spring Boot,Marklogic,如何从Flyway脚本在Marklogic中创建或验证ElementRangeIndexes。记住在我们迁移的每个Marklogic DB上手动添加elementRangeIndex是一件痛苦的事情。您可以使用来执行配置脚本 或者,您可以使用端点来使用和创建索引 使用Curl定义索引的示例取自: 谢谢Michael,我一定会尝试一下。在创建索引之前,是否有方法检查索引是否存在?@stillanovice相同的端点,而不是PUTI,我可以通过管理员用户获取范围索引数据。但是,对于具有rest_编写

如何从Flyway脚本在Marklogic中创建或验证ElementRangeIndexes。记住在我们迁移的每个Marklogic DB上手动添加elementRangeIndex是一件痛苦的事情。

您可以使用来执行配置脚本

或者,您可以使用端点来使用和创建索引

使用Curl定义索引的示例取自:


谢谢Michael,我一定会尝试一下。在创建索引之前,是否有方法检查索引是否存在?@stillanovice相同的端点,而不是PUTI,我可以通过管理员用户获取范围索引数据。但是,对于具有rest_编写器角色的用户,我无法。获取错误如下所示。想知道是否有任何特定的角色,我可以创建一个用户来测试,因为我不能在PRod中使用admin用户。
curl -X PUT  --anyauth --user admin:admin --header "Content-Type:application/json" \
-d '{"word-positions": true,
     "element-word-positions": true,
     "range-element-index":
    [ { "scalar-type": "string",
        "namespace-uri": "",
        "localname": "SPEAKER",
        "collation": "http://marklogic.com/collation/",
        "range-value-positions": false,
        "invalid-values": "reject"
      }, 
      { "scalar-type": "string",
        "namespace-uri": "",
        "localname": "affiliation",
        "collation": "http://marklogic.com/collation/",
        "range-value-positions": false,
        "invalid-values": "reject"
      }, 
      { "scalar-type": "int",
        "namespace-uri": "",
        "localname": "contentRating",
        "collation": "",
        "range-value-positions": false,
        "invalid-values": "reject"
      }, 
      { "scalar-type": "unsignedLong",
        "namespace-uri": "http://marklogic.com/filter",
        "localname": "size",
        "collation": "",
        "range-value-positions": false,
        "invalid-values": "reject"
      }, 
      { "scalar-type": "string",
        "namespace-uri": "http://marklogic.com/filter",
        "localname": "Exposure_Time",
        "collation": "http://marklogic.com/collation/",
        "range-value-positions": false,
        "invalid-values": "reject"
      }]}' \
http://localhost:8002/manage/v2/databases/TutorialDB/properties