XmlContainer::setIndexSpecification

API Ref

#include <DbXml.hpp>

void XmlContainer::setIndexSpecification(const XmlIndexSpecification &index, XmlUpdateContext &context)

void XmlContainer::setIndexSpecification(XmlTransaction &txn, const XmlIndexSpecification &index, XmlUpdateContext &context)


Description: XmlContainer::setIndexSpecification

Defines the type of indexing to be maintained for a container of documents. The currently defined indexing specification can be retrieved with the XmlContainer::getIndexSpecification method.

If the container is not empty then the contained documents are incrementally indexed. Index keys for disabled index strategies are removed and index keys for enabled index strategies are added. Note that the length of time taken to perform this re-indexing operation is proportional to the size of the container.

Parameters

txn
If the operation is to be transaction-protected, the txn parameter is an XmlTransaction handle returned from XmlManager::createTransaction.
index
The indexing specification for the container.
context
The update context to use for the index modification.

Errors

The XmlContainer::setIndexSpecification method may fail and throw XmlException, encapsulating one of the following non-zero errors:

DATABASE_ERROR
An error occurred in an underlying Berkeley DB database. The XmlException::getDbErrno method will return the error code for the error.

APIRef

Copyright (c) 1996,2007 Oracle. All rights reserved.