DB2 10.5 for Linux, UNIX, and Windows

Searching natively stored XML documents

Generally, when creating an index on an XML data column, you are not required to specify a FORMAT. Net Search Extender selects format XML by default when a text index is created on a column of type XML. The format specifiers TEXT and HTML are not allowed on XML data columns.

The following sections address search on natively stored XML documents. You are shown how the concepts of section search can be applied to natively stored XML documents and how to integrate this functionality into XQuery processing.

In the subsequent samples that illustrate the creation and use of a text index on XML columns, the following XML document is used. It is stored in table t1, column c2 of type XML.

<?xml version="1.0">
<purchaseOrder orderDate="2001-01-20">
			<shipAddress countryCode="US">
						<name>Alice Smith</name>
						<street>123 Maple Street</street>
						<city>Mill Hill</city>
						<zip>90999</zip>
			</shipAddress>
			<item partNo="123" quantity="1">
						<name>S&B Lawnmower Type ABC-x</name>
						<price>239.90</price>
						<shipDate>2001-01-25</shipdate>
			</item>
			<item partNo="987" quantity="1">
						<name>Multifunction Rake ZYX</name>
						<price>69.90</price>
						<shipDate>2001-01-24</shipdate>
			</item>
</purchaseOrder>