def get_index(self, transport, bucket, index, startkey, endkey=None, return_terms=None, max_results=None, continuation=None): """ Queries a secondary index, returning matching keys. :param bucket: the bucket whose index will be queried :type bucket: RiakBucket :param index: the index to query :type index: string :param startkey: the sole key to query, or beginning of the query range :type startkey: string, integer :param endkey: the end of the query range (optional if equality) :type endkey: string, integer :param return_terms: whether to include the secondary index value :type return_terms: boolean :param max_results: the maximum number of results to return (page size) :type max_results: integer :param continuation: the opaque continuation returned from a previous paginated request :type continuation: string :rtype: :class:`riak.client.index_page.IndexPage` """ page = IndexPage(self, bucket, index, startkey, endkey, return_terms, max_results) results, continuation = transport.get_index( bucket, index, startkey, endkey, return_terms=return_terms, max_results=max_results, continuation=continuation) page.results = results page.continuation = continuation return page
def get_index(self, transport, bucket, index, startkey, endkey=None, return_terms=None, max_results=None, continuation=None): """ get_index(bucket, index, startkey, endkey=None, return_terms=None,\ max_results=None, continuation=None) Queries a secondary index, returning matching keys. .. note:: This request is automatically retried :attr:`RETRY_COUNT` times if it fails due to network error. :param bucket: the bucket whose index will be queried :type bucket: RiakBucket :param index: the index to query :type index: string :param startkey: the sole key to query, or beginning of the query range :type startkey: string, integer :param endkey: the end of the query range (optional if equality) :type endkey: string, integer :param return_terms: whether to include the secondary index value :type return_terms: boolean :param max_results: the maximum number of results to return (page size) :type max_results: integer :param continuation: the opaque continuation returned from a previous paginated request :type continuation: string :rtype: :class:`riak.client.index_page.IndexPage` """ page = IndexPage(self, bucket, index, startkey, endkey, return_terms, max_results) results, continuation = transport.get_index(bucket, index, startkey, endkey, return_terms=return_terms, max_results=max_results, continuation=continuation) page.results = results page.continuation = continuation return page
def get_index(self, transport, bucket, index, startkey, endkey=None, return_terms=None, max_results=None, continuation=None, timeout=None, term_regex=None): """ get_index(bucket, index, startkey, endkey=None, return_terms=None,\ max_results=None, continuation=None, timeout=None,\ term_regex=None) Queries a secondary index, returning matching keys. .. note:: This request is automatically retried :attr:`retries` times if it fails due to network error. :param bucket: the bucket whose index will be queried :type bucket: RiakBucket :param index: the index to query :type index: string :param startkey: the sole key to query, or beginning of the query range :type startkey: string, integer :param endkey: the end of the query range (optional if equality) :type endkey: string, integer :param return_terms: whether to include the secondary index value :type return_terms: boolean :param max_results: the maximum number of results to return (page size) :type max_results: integer :param continuation: the opaque continuation returned from a previous paginated request :type continuation: string :param timeout: a timeout value in milliseconds, or 'infinity' :type timeout: int :param term_regex: a regular expression used to filter index terms :type term_regex: string :rtype: :class:`~riak.client.index_page.IndexPage` """ if timeout != 'infinity': _validate_timeout(timeout) page = IndexPage(self, bucket, index, startkey, endkey, return_terms, max_results, term_regex) results, continuation = transport.get_index( bucket, index, startkey, endkey, return_terms=return_terms, max_results=max_results, continuation=continuation, timeout=timeout, term_regex=term_regex) page.results = results page.continuation = continuation return page