ML Gradle 部署带有注释问题的搜索选项

ML Gradle deploy search options with annotations issues

我正在尝试使用注释部署我的搜索选项,但出现以下错误

Error caught while loading modules, cause: Local message: /config/query write failed: Bad Request. Server Message: RESTAPI-INVALIDCONTENT: (err:FOER0000) Invalid content: Operation results in invalid Options: XDMP-VALIDATENODECL: (err:XQDY0084) validate strict { $annotations } -- Missing element declaration: Expected declaration for node fn:doc("")/search:options/search:constraint[2]/search:custom/search:annotation/search:assays in non-lax mode using schema "search.xsd"fn:doc("")/search:options/search:constraint[2]/search:custom/search:annotation/search:assays"search.xsd"
com.marklogic.client.FailedRequestException: Local message: /config/query write failed: Bad Request. Server Message: RESTAPI-INVALIDCONTENT: (err:FOER0000) Invalid content: Operation results in invalid Options: XDMP-VALIDATENODECL: (err:XQDY0084) validate strict { $annotations } -- Missing element declaration: Expected declaration for node fn:doc("")/search:options/search:constraint[2]/search:custom/search:annotation/search:assays in non-lax mode using schema "search.xsd"fn:doc("")/search:options/search:constraint[2]/search:custom/search:annotation/search:assays"search.xsd"

但是相同的选项在查询控制台中工作正常。当我查找 search.xsd 时,我没有发现任何不同之处。我做错了什么? 以下是我的选项文件

<options xmlns="http://marklogic.com/appservices/search">
    <additional-query>
        <cts:and-query xmlns:cts="http://marklogic.com/cts">
            <cts:collection-query>
                <cts:uri>http://rdf.abbvienet.com/entity/abbvie/biologic</cts:uri>
            </cts:collection-query>
        </cts:and-query>
    </additional-query>
    <constraint name="target">
        <custom facet="false">
            <parse apply="parse-string"
                   ns="http://ir.abbvienet.com/pikm-datahub/custom-constraints/abbvie-biologic/abbvieBiologicTargetConstraint"
                   at="/lib/custom-constraints/abbvie-biologic/abbvieBiologicTargetConstraint.xqy"/>
        </custom>
    </constraint>

    <constraint name="documents">
        <custom facet="true">
            <parse apply="parse-string"
                   ns="http://ir.abbvienet.com/pikm-datahub/custom-constraints/abbvie-biologic/abbvieBiologicDadsELNConstraint"
                   at="/lib/custom-constraints/abbvie-biologic/abbvieBiologicDadsELNConstraint.xqy"/>
            <start-facet apply="start-facet"
                         ns="http://ir.abbvienet.com/pikm-datahub/custom-constraints/abbvie-biologic/abbvieBiologicDadsELNConstraint"
                         at="/lib/custom-constraints/abbvie-biologic/abbvieBiologicDadsELNConstraint.xqy"/>
            <finish-facet apply="finish-facet"
                          ns="http://ir.abbvienet.com/pikm-datahub/custom-constraints/abbvie-biologic/abbvieBiologicDadsELNConstraint"
                          at="/lib/custom-constraints/abbvie-biologic/abbvieBiologicDadsELNConstraint.xqy"/>
            <facet-option>frequency-order</facet-option>
            <facet-option>descending</facet-option>
            <facet-option>concurrent</facet-option>
            <annotation>
                <assays>
                    <assay label="Flow Cytometry">Flow Cytometry|FAC|Flow</assay>
                    <assay label="Immunohistochemistry">Immunohistochemistry|IHC</assay>
                    <assay label="Western Blot">Western Blot|Western</assay>
                    <assay label="Elisa">Elisa</assay>
                    <assay label="Binding Assay">Binding Assay|Biacore</assay>
                </assays>
            </annotation>
        </custom>
    </constraint>
    <term>
        <term-option>case-insensitive</term-option>
        <term-option>punctuation-insensitive</term-option>
        <term-option>whitespace-insensitive</term-option>
        <term-option>wildcarded</term-option>
    </term>
    <extract-document-data selected="include">
        <extract-path xmlns:ab="http://schemas.abbvienet.com/entity/abbvie/biologic">//ab:id</extract-path>
        <extract-path xmlns:ab="http://schemas.abbvienet.com/entity/abbvie/biologic">//ab:name</extract-path>
        <extract-path xmlns:ab="http://schemas.abbvienet.com/entity/abbvie/biologic">//ab:alternate-name</extract-path>
        <extract-path xmlns:ab="http://schemas.abbvienet.com/entity/abbvie/biologic">//ab:entity-type</extract-path>
        <extract-path xmlns:ab="http://schemas.abbvienet.com/entity/abbvie/biologic">//ab:entity-sub-type</extract-path>
        <extract-path xmlns:ab="http://schemas.abbvienet.com/entity/abbvie/biologic">//ab:scientist</extract-path>
        <extract-path xmlns:ab="http://schemas.abbvienet.com/entity/abbvie/biologic">//ab:registrar</extract-path>
        <extract-path xmlns:ab="http://schemas.abbvienet.com/entity/abbvie/biologic">//ab:project</extract-path>
        <extract-path xmlns:ab="http://schemas.abbvienet.com/entity/abbvie/biologic">//ab:isotype</extract-path>
        <extract-path xmlns:ab="http://schemas.abbvienet.com/entity/abbvie/biologic">//ab:species</extract-path>
        <extract-path xmlns:ab="http://schemas.abbvienet.com/entity/abbvie/biologic">//ab:comments</extract-path>
    </extract-document-data>
    <transform-results apply="empty-snippet"/>
</options>

当我从我的第二个约束中删除 <annotation> 标记时,将部署选项文件。当我查看 search.xsd 时,我没有发现我的 <annotation> 元素有任何问题 ..

奇怪的是,错误消息指的是搜索:annotation/search:region,但选项不显示该元素。

在注释元素上声明一个空的默认命名空间可能会有所帮助,如下所示:

<annotation xmlns="">

这样,注释子元素将不会在搜索命名空间中,因此永远不会根据搜索架构进行验证。