Exemplo n.º 1
0
    def get_record_data_from_es(record):
        """Queries Elastic Search for this record and returns it as dictionary

        Returns:
            dict:This record in a way it is represented in Elastic Search

        """
        endpoint = PidStoreBase._get_config_pid_types_to_endpoints()[record.pid_type]
        search_conf = current_app.config["RECORDS_REST_ENDPOINTS"][endpoint]
        search_class = search_conf["search_class"]()
        return search_class.get_source(record.id)
Exemplo n.º 2
0
def test_get_config_for_endpoints(appctx):
    pids_to_endpoints = PidStoreBase._get_config_pid_types_to_endpoints()

    assert pids_to_endpoints is not None