Example: Index XML tag values and XML tag names
Use the include_contents parameter to search both XML tag values and XML tag names.
Given the XML
fragment:
<book>
<title>Graph Theory</title>
<author>Stewart</author>
<date>January 14, 2006</date>
</book>
To create a bts index for all
the tags as well as the XML tags in their unstructured form, use the
statement:
CREATE INDEX book_bts ON books(xml_data bts_lvarchar_ops)
USING bts(all_xmltags="yes",include_contents="yes")
IN bts_sbspace;
The index will have four fields;
one for each of the XML tags and one for the
contents
field:
title:graph theory
author:stewart
date:january 14, 2006
contents:<book> <title>Graph Theory</title> <author>Stewart</author>
<date>January 14, 2006</date> </book>