#NEWLINE# def stream_index( self , bucket , index , startkey , endkey = None , return_terms = None , max_results = None , continuation = None , timeout = None , term_regex = None ) : #NEWLINE# #INDENT# '\n        Streams a secondary index query.\n        ' #NEWLINE# if ( not self . stream_indexes ( ) ) : #NEWLINE# #INDENT# raise NotImplementedError ( ( 'Secondary index streaming is not supported on %s' % self . server_version . vstring ) ) #NEWLINE# #UNINDENT# if ( term_regex and ( not self . index_term_regex ( ) ) ) : #NEWLINE# #INDENT# raise NotImplementedError ( ( 'Secondary index term_regex is not supported on %s' % self . server_version . vstring ) ) #NEWLINE# #UNINDENT# if ( timeout == 'infinity' ) : #NEWLINE# #INDENT# timeout = 0 #NEWLINE# #UNINDENT# params = { #NEWLINE# #INDENT# 'return_terms' : return_terms , #NEWLINE# 'stream' : True , #NEWLINE# 'max_results' : max_results , #NEWLINE# 'continuation' : continuation , #NEWLINE# 'timeout' : timeout , #NEWLINE# 'term_regex' : params , #NEWLINE# #UNINDENT# } #NEWLINE# bucket_type = self . _get_bucket_type ( bucket . bucket_type ) #NEWLINE# url = self . index_path ( bucket . name , index , startkey , endkey , bucket_type = bucket_type , ** params ) #NEWLINE# ( status , headers , response ) = self . _request ( 'GET' , url , stream = True ) #NEWLINE# if ( status == 200 ) : #NEWLINE# #INDENT# return HttpIndexStream ( response , index , return_terms ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise RiakError ( 'Error streaming secondary index.' )