eXist-db 范围索引中的条件组合索引失败

Failure of conditional combination index in eXist-db range index

我在eXist-db配置范围索引指定值得索引的属性时遇到了以下问题

<collection xmlns="http://exist-db.org/collection-config/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <index>
        <range>
            <create qname="tei:term">
                <condition attribute="type" value="main"/>
                <field name="mainTerm" type="xs:string"/>
            </create>
        </range>
    </index></collection>

发生错误:/db/system/config/db/range/collection.xconf cvc-complex-type.2.4.a:发现以元素 'condition' 开头的无效内容。“{”之一“= 11=]":field}' 是预期的。" 请帮助我。

一般配置结构和语法 索引配置 collection.xconf 文件是标准 XML 文档,其元素和属性由 eXist-db 命名空间 http://exist-db.org/collection-config/1.0 定义。以下示例显示了一个配置示例:

<collection xmlns="http://exist-db.org/collection-config/1.0">
    <index>
        <!-- Full text index based on Lucene -->
        <lucene>
            <text qname="SPEECH">
                <ignore qname="SPEAKER"/>
            </text>
            <text qname="TITLE"/>
        </lucene>

        <!-- Range indexes -->
        <range>
            <create qname="title" type="xs:string"/>
            <create qname="author" type="xs:string"/>
            <create qname="year" type="xs:integer"/>
        </range>
        <!-- N-gram indexes -->
        <ngram qname="author"/>
        <ngram qname="title"/>
    </index>
</collection>

要使用新的范围索引,请将范围索引定义包装到范围元素中:

<collection xmlns="http://exist-db.org/collection-config/1.0">
    <!--from Tamboti-->
    <index xmlns:mods="http://www.loc.gov/mods/v3">
        <lucene>
            <text qname="mods:title"/>
        </lucene>
        <!-- Range indexes -->
        <range>
            <create qname="mods:namePart" type="xs:string" case="no"/>
            <create qname="mods:dateIssued" type="xs:string"/>
            <create qname="@ID" type="xs:string"/>
        </range>
    </index>
</collection>

条件组合索引 对于组合索引,您可以指定条件以将被索引的值限制为具有满足特定条件的属性的元素中包含的值:

<range>
            <create qname="tei:term">
                <condition attribute="type" value="main"/>
                <field name="mainTerm" type="xs:string"/>
            </create>
        </range>

这只会索引 tei:term 元素的值,如果它有一个名为 type 的属性且值为 main。可以在索引定义中指定多个条件,在这种情况下,所有条件都需要匹配才能对值进行索引。

确保您的 xml 有效。有关详细信息,您可以在此处阅读文档:https://exist-db.org/exist/apps/doc/newrangeindex.xml

您收到的错误是模式验证错误,由最近引入的 conditional combined index 功能使用的 <condition> 元素的存在触发。

我已提交 a fix 错误,现在,您可以忽略该错误。模式验证错误不会对功能产生任何影响。