def fieldMinMax(self, name, q='*:*', fq=None):
        """Returns the minimum and maximum values of the specified field. This requires
        two search calls to the service, each requesting a single value of a single
        field.

        @param name(string) Name of the field
        @param q(string) Query identifying range of records for min and max values
        @param fq(string) Filter restricting range of query

        @return list of [min, max]

        """
        minmax = [None, None]
        oldpersist = self.persistent
        self.persistent = True
        params = {
            'q': q,
            'rows': 1,
            'fl': name,
            'sort': '%s asc' % name,
            'wt': 'python',
        }
        if fq is not None:
            params['fq'] = fq
        try:
            data = self.search(params)
            minmax[0] = data['response']['docs'][0][name][0]
            params['sort'] = '%s desc' % name
            data = self.search(params)
            minmax[1] = data['response']['docs'][0][name][0]
        except Exception as e:
            self.logger.debug('Exception in MinMax: %s' % str(e))
            pass
        finally:
            self.persistent = oldpersist
            if not self.persistent:
                self.conn.close()
        return minmax
def fieldMinMax ( self , name , q = '*:*' , fq = None ) : minmax = [ None , None ] oldpersist = self . persistent self . persistent = True params = { 'q' : q , 'rows' : 1 , 'fl' : name , 'sort' : '%s asc' % name , 'wt' : 'python' , } if fq is not None : params [ 'fq' ] = fq try : data = self . search ( params ) minmax [ 0 ] = data [ 'response' ] [ 'docs' ] [ 0 ] [ name ] [ 0 ] params [ 'sort' ] = '%s desc' % name data = self . search ( params ) minmax [ 1 ] = data [ 'response' ] [ 'docs' ] [ 0 ] [ name ] [ 0 ] except Exception as e : self . logger . debug ( 'Exception in MinMax: %s' % str ( e ) ) pass finally : self . persistent = oldpersist if not self . persistent : self . conn . close ( ) return minmax
Returns the minimum and maximum values of the specified field. This requires
        two search calls to the service, each requesting a single value of a single
        field.

        @param name(string) Name of the field
        @param q(string) Query identifying range of records for min and max values
        @param fq(string) Filter restricting range of query

        @return list of [min, max]