def search(query,types=nil,never_or=nil,extras=nil,start=nil,count=nil)
      result = search_json query,types,never_or,extras,start,count
      return result if not result
      results = result['results'] || []
      api = self
      #
      # This start out nil, because we need to reference classes in
      # types.rb and this gets loaded after this file.  There's
      # probably a better way to do this.
      #
      if not @@types2classes
        @@types2classes = {
          'r' => Artist,
          'a' => Album,
          's' => User,
          't' => Track,
          'p' => Playlist
        }
      end
      results.map {|o| @@types2classes[o['type']].new(api).fill o}
    end
def search(query,types=nil,never_or=nil,extras=nil,start=nil,count=nil)
      result = search_json query,types,never_or,extras,start,count
      return result if not result
      results = result['results'] || []
      api = self
      #
      # This start out nil, because we need to reference classes in
      # types.rb and this gets loaded after this file.  There's
      # probably a better way to do this.
      #
      if not @@types2classes
        @@types2classes = {
          'r' => Artist,
          'a' => Album,
          's' => User,
          't' => Track,
          'p' => Playlist
        }
      end
      results.map {|o| @@types2classes[o['type']].new(api).fill o}
    end
Search for artists, albums, tracks, users or all kinds of objects.