def parse_results(solr_data, options = {})
      results = {
        :docs => [],
        :total => 0
      }

      configuration = {
        :format => :objects
      }
      results.update(:spellcheck => solr_data.data['spellcheck']) unless solr_data.nil?
      results.update(:facets => {'facet_fields' => []}) if options[:facets]
      unless solr_data.nil? or solr_data.header['params'].nil?
        header = solr_data.header
        results.update :rows => header['params']['rows']
        results.update :start => header['params']['start']
      end
      return SearchResults.new(results) if (solr_data.nil? || solr_data.total_hits == 0)

      configuration.update(options) if options.is_a?(Hash)

      ids = solr_data.hits.collect {|doc| doc["#{solr_configuration[:primary_key_field]}"]}.flatten

      result = find_objects(ids, options, configuration)

      add_scores(result, solr_data) if configuration[:format] == :objects && options[:scores]

      highlighted = {}
      solr_data.highlighting.map do |x,y|
        e={}
        y1=y.map{|x1,y1| e[x1.gsub(/_[^_]*/,"")]=y1} unless y.nil?
        highlighted[x.gsub(/[^:]*:/,"").to_i]=e
        end unless solr_data.highlighting.nil?

      results.update(:facets => solr_data.data['facet_counts']) if options[:facets]
      results.update({:docs => result, :total => solr_data.total_hits, :max_score => solr_data.max_score, :query_time => solr_data.data['responseHeader']['QTime']})
      results.update({:highlights=>highlighted})
      SearchResults.new(results)
    end
def parse_results(solr_data, options = {})
      results = {
        :docs => [],
        :total => 0
      }

      configuration = {
        :format => :objects
      }
      results.update(:spellcheck => solr_data.data['spellcheck']) unless solr_data.nil?
      results.update(:facets => {'facet_fields' => []}) if options[:facets]
      unless solr_data.nil? or solr_data.header['params'].nil?
        header = solr_data.header
        results.update :rows => header['params']['rows']
        results.update :start => header['params']['start']
      end
      return SearchResults.new(results) if (solr_data.nil? || solr_data.total_hits == 0)

      configuration.update(options) if options.is_a?(Hash)

      ids = solr_data.hits.collect {|doc| doc["#{solr_configuration[:primary_key_field]}"]}.flatten

      result = find_objects(ids, options, configuration)

      add_scores(result, solr_data) if configuration[:format] == :objects && options[:scores]

      highlighted = {}
      solr_data.highlighting.map do |x,y|
        e={}
        y1=y.map{|x1,y1| e[x1.gsub(/_[^_]*/,"")]=y1} unless y.nil?
        highlighted[x.gsub(/[^:]*:/,"").to_i]=e
        end unless solr_data.highlighting.nil?

      results.update(:facets => solr_data.data['facet_counts']) if options[:facets]
      results.update({:docs => result, :total => solr_data.total_hits, :max_score => solr_data.max_score, :query_time => solr_data.data['responseHeader']['QTime']})
      results.update({:highlights=>highlighted})
      SearchResults.new(results)
    end
Parses the data returned from Solr