def search(request):
    service = str(request.GET.get('service', 'nova'))
    field = request.GET.get('field')
    value = request.GET.get('value')
    model = _model_factory(service)
    filters = {field: value}
    _add_when_filters(request, filters)
    results = []
    try:

        events = model_search(request, model, filters, order_by='-when')
        for event in events:
            when = dt.dt_from_decimal(event.when)
            routing_key_status = routing_key_type(event.routing_key)
            results = event.search_results(results, when, routing_key_status)
        return rsp(json.dumps(results))
    except __HOLE__:
        return error_response(404, 'Not Found', ["The requested object does not exist"])
    except FieldError:
        return error_response(400, 'Bad Request', "The requested field '%s' does not exist for the corresponding object.\n"
                    "Note: The field names of database are case-sensitive." % field)
dataset/ETHPy150Open openstack/stacktach/stacktach/stacky_server.py/search