Defining an index on a choice element
"Harris, Bernard T. \(GSFC-5870\) via Exist-open" <[email protected]>
| Newsgroups | gmane.text.xml.exist |
|---|---|
| Message-ID | <[email protected]> |
I need to do queries like
Let $docs := collection(“/db/SPASE”)
Let $type := “NumericalData”
Let $result := $docs/Spase/*[name() = $type]
Where $type may be the name of any one of many “choice” elements from the schema https://spase-group.org/data/schema/spase-2.5.0.xsd
…
<xsd:complexType name="Spase">
<xsd:sequence>
<xsd:element name="Version" type="spase:Version" minOccurs="1" maxOccurs="1" />
<xsd:choice minOccurs="1" maxOccurs="unbounded">
<xsd:element name="Collection" type="spase:Collection" />
<xsd:element name="Catalog" type="spase:Catalog" />
<xsd:element name="DisplayData" type="spase:DisplayData" />
<xsd:element name="NumericalData" type="spase:NumericalData" />
<xsd:element name="Document" type="spase:Document" />
<xsd:element name="Software" type="spase:Software" />
<xsd:element name="Granule" type="spase:Granule" />
<xsd:element name="Instrument" type="spase:Instrument" />
<xsd:element name="Observatory" type="spase:Observatory" />
<xsd:element name="Person" type="spase:Person" />
<xsd:element name="Registry" type="spase:Registry" />
<xsd:element name="Repository" type="spase:Repository" />
<xsd:element name="Service" type="spase:Service" />
<xsd:element name="Annotation" type="spase:Annotation" />
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="lang" type="xsd:string" default="en"/>
</xsd:complexType>
…
As expected, this performs poorly without a range index. But what is the qname of the choice? Do I have to define an index for each choice? That is, 14 range indexes for Collection, Catalog, …. Thanks.
Bernie
_______________________________________________
Exist-open mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/exist-open