def provider_lookup(node, search_terms)
      provider_results = {}
      search_results = {}

      node.sources.each do |provider, prov_class|
        if prov_class.respond_to? :search
          search_terms.each do |search_term|
            search_result = prov_class.send :search, search_term
            search_results[search_term] = search_result if search_result
          end

          provider_results[provider] = search_results

        else
          raise ProviderNotAvailableError, "Method 'search' not available for provider #{provider}"
        end
      end

      provider_results
    end
def provider_lookup(node, search_terms)
      provider_results = {}
      search_results = {}

      node.sources.each do |provider, prov_class|
        if prov_class.respond_to? :search
          search_terms.each do |search_term|
            search_result = prov_class.send :search, search_term
            search_results[search_term] = search_result if search_result
          end

          provider_results[provider] = search_results

        else
          raise ProviderNotAvailableError, "Method 'search' not available for provider #{provider}"
        end
      end

      provider_results
    end
Performs a search operation, looking up each search term
 on each provider (by way of Provider#search), and storing it in a Hash.
 Parameters:
 +node+:: The FROM node that contains search provider sources
 +search_terms+:: The search terms from a SELECT node, as an array
 Returns:
 +provider_results+::A Hash that contains the provider as a key, and the
 search term as a value, which can be used to lookup the result via
 'result[:provider][:search_term]'.