def _filter_to_index_query(self, field, op, value, queue):
        if isinstance(value, basestring):
            index_type = 'bin'
            min = chr(0) * MAX_STRING_LENGTH
            max = chr(127) * MAX_STRING_LENGTH
            if op == '>':
                value = value + ((MAX_STRING_LENGTH - len(value)) * chr(0))
            elif op == '<':
                value = value[:-1] + chr(ord(value[-1]) - 1)
        else:
            if isinstance(value, float):
                value = int(value * FLOAT_PRECISION_LEVEL)
            index_type = 'int'
            max = int(sys.float_info.max)
            min = -max
            if op == '>':
                value += 1
            elif op == '<':
                value -= 1

        field = '%s_%s' % (field, index_type)
        results = set()

        if op == '==':
            [results.add(res.get_key())
             for res in self._client.index(self._bucket, field, value).run()]
        elif op == '>' or op == '>=':
            [results.add(res.get_key())
             for res in self._client.index(self._bucket, field, value,
                                           max).run()]
        elif op == '<' or op == '<=':
            [results.add(res.get_key())
             for res in self._client.index(self._bucket, field, min,
                                           value).run()]
        else:
            raise InvalidFilterOperation(op)
        # push the results to the queue
        queue.put(results)
Convert a filter query to Riak index query.
dataset/ETHPy150Open mining/mining/mining/db/backends/mriak/multiquery.py/RiakMultiIndexQuery._filter_to_index_query