Skip to content

Add new assertion on text element in collection.xconf.xsd #6002

@daliboris

Description

@daliboris

Following index definition shouldn't be valid, when indexing it throws all instances of a given field name must have the same term vectors settings (storeTermVectors changed for field="p-field") error.

<collection>
  <index>
    <lucene>
      <text qname="tei:p" field="p-field">
        <field name="p-field" />
      </text>
    </lucene>
  </index>
</collection>

The problem is caused by identical field names in the text index definition and in the field definition. (That would be valid: <text qname="tei:p" field="p-field"> <field name="p-field-inner" />).

Change textType definition in the XSD Schema to validate this issue:

<xs:complexType name="textType">
        <xs:annotation>
            <xs:documentation>Either @qname or @match must be specified. Not both!</xs:documentation>
            <xs:documentation>If both text/@field and field/@name exist, their values must be different!</xs:documentation>
        </xs:annotation>
        <xs:group ref="cc:textInstruction"/>
        <xs:attributeGroup ref="cc:qnameOpt"/>
        <xs:attributeGroup ref="cc:matchOpt"/>
        <xs:attributeGroup ref="cc:analyzerOpt"/>
        <xs:attributeGroup ref="cc:boostOpt"/>
        <xs:attributeGroup ref="cc:fieldOpt"/>
        <xs:attributeGroup ref="cc:indexOpt"/>
        <xs:assert test="(@qname and not(@match)) or (@match and not(@qname))"/>
        <xs:assert test="not(exists(@field)) or not(@field = cc:field/@name)" />
    </xs:complexType>

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementnew features, suggestions, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions