how to index properly?

I have an urgent problem, if someone could help. I have an XML file, which basically looks like this:

<TEI.2>

text value

<TEI.2>

</TEI.2>

I then index the

element with standard index in the schema as follows:
<xs:element name = “pa”>
xs:annotation
xs:appinfo
tsd:elementInfo
tsd:physical
tsd:native
tsd:index
tsd:standard/
</tsd:index>
</tsd:native>
</tsd:physical>
</tsd:elementInfo>
</xs:appinfo>
</xs:annotation>
<xs:complexType mixed = “true”>
<xs:choice minOccurs = “0” maxOccurs = “unbounded”>
<xs:element ref = “abbr”></xs:element>
<xs:element ref = “address”></xs:element>
</xs:choice>
<xs:attribute name = “corresp” type = “xs:IDREFS”></xs:attribute>
<xs:attribute name = “synch” type = “xs:IDREFS”></xs:attribute>
</xs:complexType>
</xs:element>

The problem is the performance for the text retrieval query is not improved, rather degraded a bit. And in the output from adding <?explain?> to the query, I did not see any XqcUnnestStdIdxScan element. Does this mean I did not index correctly. FYI, the query I executed is as follows:

for $a in input()/TEI/TEI.2/body//p[contains(.“Omaha”)]
return $a

Hi,

In order to improve the performance of text retrieval queries you have to define a text index on the elements you want to query. You also should use the tf:containsText() function instead of contains().

Best regards,

Thorsten Fiebig

I tried the text index too. But when I trace the output using {?explain?}, the element was not shown to be indexed. What went wrong?

Hi,

Did you use the tf:containsText() function? The according query looks like this:

declare namespace tf=“http://namespaces.softwareag.com/tamino/TaminoFunction
for $a in input()/TEI/TEI.2/body//p
where tf:containsText($a,“Omaha”)
return $a

Best Regards,

Thorsten Fiebig

Yes, I tried ft:containsText(). But I don’t think it is indexed. To make sure, which element should I look for in the {?explain?} output to see that the element is indexed?