Class: Kaltura::KalturaSearchService

Inherits:
KalturaServiceBase show all
Defined in:
lib/kaltura_client.rb

Overview

Search service allows you to search for media in various media providers

This service is being used mostly by the CW component

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaSearchService

Returns a new instance of KalturaSearchService.



12677
12678
12679
# File 'lib/kaltura_client.rb', line 12677

def initialize(client)
	super(client)
end

Instance Method Details

#external_login(search_source, user_name, password) ⇒ Object



12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
# File 'lib/kaltura_client.rb', line 12724

def (search_source, user_name, password)
	kparams = {}
	client.add_param(kparams, 'searchSource', search_source);
	client.add_param(kparams, 'userName', user_name);
	client.add_param(kparams, 'password', password);
	client.queue_service_action_call('search', 'externalLogin', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#get_media_info(search_result) ⇒ Object

Retrieve extra information about media found in search action Some providers return only part of the fields needed to create entry from, use this action to get the rest of the fields.



12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
# File 'lib/kaltura_client.rb', line 12698

def get_media_info(search_result)
	kparams = {}
	# KalturaSearchResult object extends KalturaSearch and has all fields required for media:add
	client.add_param(kparams, 'searchResult', search_result);
	client.queue_service_action_call('search', 'getMediaInfo', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#search(search, pager = KalturaNotImplemented) ⇒ Object

Search for media in one of the supported media providers



12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
# File 'lib/kaltura_client.rb', line 12683

def search(search, pager=KalturaNotImplemented)
	kparams = {}
	# A KalturaSearch object contains the search keywords, media provider and media type
	client.add_param(kparams, 'search', search);
	client.add_param(kparams, 'pager', pager);
	client.queue_service_action_call('search', 'search', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#search_url(media_type, url) ⇒ Object

Search for media given a specific URL Kaltura supports a searchURL action on some of the media providers. This action will return a KalturaSearchResult object based on a given URL (assuming the media provider is supported)



12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
# File 'lib/kaltura_client.rb', line 12713

def search_url(media_type, url)
	kparams = {}
	client.add_param(kparams, 'mediaType', media_type);
	client.add_param(kparams, 'url', url);
	client.queue_service_action_call('search', 'searchUrl', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end