Oracle Text
XML data stored as XMLTypes in either CLOBs or XML Schema–based structured storage can be indexed by Oracle Text. For example, to create an Oracle Text index and query the product table, you can use the following code:CREATE INDEX desc_idx ON product(description)
INDEXTYPE IS CTXSYS.CONTEXT
PARAMETERS('section group ctxsys.path_section_group');
Note | You must have the CTXAPP role granted to create the Oracle Text indexes. |
Thereafter, you can use the CONTAINS() function in SQL queries to search the XML content as follows:
SELECT name
FROM product
WHERE CONTAINS(description,'about(xml utilities)')>0;
The about() is provided in Oracle Text to allow semantic search. There are additional XML search capabilities. For example, you can do the following:
Use the ora.contains() function in XMLType.existsNode() for text searches within XPath-based searches.
Use the HASPATH() and INPATH() operators to optimize XML data searches within the content specified by the XPath expressions.
Additionally, Oracle Text searching capabilities are integrated into XMLType by introducing the new CTXXPATH index. This is detailed in Chapter 11, where we will also discuss how you can create various SQL indexes on XMLTypes, such as B*Tree indexes, bitmap indexes, and functional indexes to speed up queries on the XML documents.
Oracle Advanced Queuing
Oracle Advanced Queuing supports XMLType as a message type. In other words, users can enqueue and dequeue XML messages from and into XMLTypes. In later chapters, you will see examples using the XMLType message queues and how to use XMLType functions for message processing.