XmlContainer::lookupIndex

API Ref

#include <DbXml.hpp>

XmlResults XmlContainer::lookupIndex(XmlQueryContext &context, const std::string &uri, const std::string &name, const std::string &index, const XmlValue &value = XmlValue(), u_int32_t flags = 0)

XmlResults XmlContainer::lookupIndex(XmlTransaction &txn, XmlQueryContext &context, const std::string &uri, const std::string &name, const std::string &index, const XmlValue &value = XmlValue(), u_int32_t flags = 0)

XmlResults XmlContainer::lookupIndex(XmlQueryContext &context, const std::string &uri, const std::string &name, const std::string &parent_uri, const std::string &parent_name, const std::string &index,const XmlValue &value = XmlValue(), u_int32_t flags = 0)

XmlResults XmlContainer::lookupIndex(XmlTransaction &txn, XmlQueryContext &context, const std::string &uri, const std::string &name, const std::string &parent_uri, const std::string &parent_name, const std::string &index, const XmlValue &value = XmlValue(),u_int32_t flags = 0)


Description: XmlContainer::lookupIndex

For a specified index, return all the data referenced by the index's keys, optionally matching a specific value.


Description: XmlStatistics XmlContainer::lookupIndex(XmlTransaction &txn, XmlQueryContext &context, const std::string &uri, const std::string &name, const std::string &index, const XmlValue &value = XmlValue(), u_int32_t flags = 0)

Return all the targets for which the identified index has keys. By default, entire documents are returned by this method. However, if the container is of type XmlContainer::NodeStorage (the default container type), and if DBXML_INDEX_NODES is set for the container, then this method will return the individual nodes referenced by the index keys.

Note that you cannot use this form of this method to examine edge indices.

Parameters

txn
If the operation is to be transaction-protected, the txn parameter is an XmlTransaction handle returned from XmlManager::createTransaction.
context
The XmlQueryContext to use for this query.
uri
The namespace of the node to which this index is applied.
name
The name of the node to which this index is applied.
index
Identifies the index for which you want the documents returned. The value supplied here must be a valid index. See XmlIndexSpecification::addIndex for a description of valid index specifications.
value
Provides the value to which equality indices must be equal. This parameter is required when returning documents on equality indices, and it is ignored for all other types of indices.
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
m4_read_uncommitted_flag
DB_RMW
Acquire write locks instead of read locks when doing the retrieval. Setting this flag can eliminate deadlock during a read-modify-write cycle by acquiring the write lock during the read part of the cycle so that another thread of control acquiring a read lock for the same item, in its own read-modify-write cycle, will not result in deadlock.
DBXML_LAZY_DOCS
Retrieve the document lazily. That is, retrieve document content and document metadata only on an as needed basis when reading the document.

Errors

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

UNKNOWN_INDEX
Unknown index specification

Description: XmlStatistics XmlContainer::lookupIndex(XmlTransaction &txn, XmlQueryContext &context, const std::string &uri, const std::string &name, const std::string &parent_uri, const std::string &parent_name, const std::string &index, const XmlValue &value = XmlValue(), u_int32_t flags = 0)

Return all the targets for which the identified index has keys. By default, entire documents are returned by this method. However, if node storage containers are in use (the default container type) and if DBXML_INDEX_NODES is set for the container, then this method will return the individual nodes referenced by the index keys.

Use this form of this method to return documents indexed by edge indices.

Edge indices are indices maintained for those locations in a document where two nodes (a parent node and a child node) meet. See the Berkeley DB XML Getting Started Guide for details.

Parameters

txn
If the operation is to be transaction-protected, the txn parameter is an XmlTransaction handle returned from XmlManager::createTransaction.
context
The XmlQueryContext to use for this query.
uri
The namespace of the node to which this edge index is applied.
name
The name of the node to which this edge index is applied.
parent_uri
The namespace of the parent node to which this edge index is applied.
parent_name
The name of the parent node to which this edge index is applied.
index
Identifies the index for which you want the documents returned. The value supplied here must be a valid index. See XmlIndexSpecification::addIndex for a description of valid index specifications.
value
Provides the value to which equality indices must be equal. This parameter is required when returning documents indexed by equality indices, and it is ignored for all other types of indices.
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
m4_read_uncommitted_flag
DB_RMW
Acquire write locks instead of read locks when doing the retrieval. Setting this flag can eliminate deadlock during a read-modify-write cycle by acquiring the write lock during the read part of the cycle so that another thread of control acquiring a read lock for the same item, in its own read-modify-write cycle, will not result in deadlock.
DBXML_LAZY_DOCS
Retrieve the document lazily. That is, retrieve document content and document metadata only on an as needed basis when reading the document.

Errors

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

UNKNOWN_INDEX
Unknown index specification

APIRef

Copyright (c) 1996-2005 Sleepycat Software, Inc. - All rights reserved.