import requests


def search_recommendations_raw(config_data):
    """
    Post a raw request to do a recommendations search.

    Args:
        config_data (dict): Contains configuration data for the request.

    Returns:
        dict: JSON output from the "search recommendations" API.
    """
    url = "{0}recommendation-service/v1/orgs/{1}/recommendation/_search".format(config_data['hostname'],
                                                                                config_data['org_key'])
    request_body = {'criteria': {'status': ['NEW', 'REJECTED', 'ACCEPTED']},
                    'sort': [{'field': 'impact_score', 'order': 'DESC'}]}
    request_headers = {'X-Auth-Token': config_data['apikey']}
    response = requests.post(url, json=request_body, headers=request_headers)
    return response.json()