#include <DbXml.hpp> void XmlContainer::setAutoIndexing(bool value, XmlUpdateContext &context) void XmlContainer::setAutoIndexing(XmlTransaction &txn, bool value, XmlUpdateContext &context)
Sets the auto-indexing state of the container.
If the value on the container is true (the default for newly-created containers) then indexes are added automatically for leaf elements and attributes. The indexes added are "node-equality-string" and "node-equality-double" for elements and attributes. If auto-indexing is not desired it should be disabled using this interface immediately after container creation. Auto-indexing is recognized by insertion of new documents as well as updates of existing documents, including modification via XQuery Update. The auto-indexing state is persistent and will remain stable across container close/re-open operations. Indexes added via auto-indexing are normal indexes and can be removed using the normal mechanisms.
A significant implication of auto-indexing is that any operation that may add an index (e.g. XmlContainer::putDocument) can have the side effect of reindexing the entire container. For this reason auto-indexing is not recommended for containers of heterogenous documents and that it be disabled once a representative set of documents has been inserted.
If the operation is to be transaction-protected, the
txn
parameter is an
XmlTransaction
handle
returned from XmlManager::createTransaction.
The XmlContainer::setAutoIndexing
method may
fail and throw
XmlException
, encapsulating one of the following
non-zero errors:
An error occurred in an underlying Berkeley DB database. The XmlException::getDbErrno method will return the error code for the error.