XmlContainer::addIndex |
![]() ![]() |
#include <DbXml.hpp>void XmlContainer::addIndex( const std::string &uri, const std::string &name, const std::string &index, XmlUpdateContext &context)
XmlContainer::addIndex( XmlTransaction &txn, const std::string &uri, const std::string &name, const std::string &index, XmlUpdateContext &context)
XmlContainer::addIndex( const std::string &uri, const std::string &name, XmlIndexSpecification::Type type, XmlValue::Type syntax, XmlUpdateContext &context)
XmlContainer::addIndex( XmlTransaction &txn, const std::string &uri, const std::string &name, XmlIndexSpecification::Type type, XmlValue::Type syntax, XmlUpdateContext &context)
Adds an index of the specified type for the named document node. These method are for convenience -- see XmlIndexSpecification::addIndex for more information.
Identifies one or more indexing strategies to set for the identified node. The strategies are identified as a space-separated listing of strings.
unique-{path type}-{node type}-{key type}-{syntax}
where:
unique indicates that the indexed value is unique in the container. If this keyword does not appear on the index string, then the indexed value is not required to be unique in the container.
{path type} is either node or edge.
{node type} is one of element, attribute, or metadata. If metadata is specified, then {path type} must be node.
{key type} is one of presence, equality, or substring.
{syntax} identifies the type of information being indexed. It must be one of the following values:
Note that if {key type} is presence, then {syntax} must be none or simply not specified.
For example, examples index strings are:
unique-node-element-presence
node-element-equality-string
edge-element-presence-none
node-element-equality-float
The XmlContainer::addIndex method may fail and throw XmlException, encapsulating one of the following non-zero errors:
Identifies an indexing strategy to set for the identified node. The strategy is set using enumeration values for the index and the syntax.
To indicate whether the indexed value must be unique container-wide, use one of the following, or leave the value out entirely:
To identify the path type, use one of the following:
To identify the node type, use one of the following:
Note that if XmlIndexSpecification::NODE_METADATA is used, then XmlIndexSpecification::PATH_NODE must also be used as well.
To identify the key type, use one of the following:
For example:
XmlIndexSpecification::PATH_NODE | XmlIndexSpecification::NODE_ELEMENT | XmlIndexSpecification::KEY_SUBSTRING
Identifies the type of information being indexed. The value must be one of the XmlValue enumerated types:
Note that if XmlIndexSpecification::KEY_PRESENCE is specified for type, then this parameter must be XmlValue::NONE.
The XmlContainer::addIndex method may fail and throw XmlException, encapsulating one of the following non-zero errors:
![]() ![]() |
Copyright (c) 1996-2005 Sleepycat Software, Inc. - All rights reserved.