Class: Amazon::AWS::ItemSearch

Inherits:
Operation show all
Defined in:
lib/ruby-paa/aws.rb

Overview

This is the class for the most common type of AWS look-up, an ItemSearch. This allows you to search for items that match a set of broad criteria. It returns items for sale by Amazon merchants and most types of seller.

Constant Summary collapse

SEARCH_INDICES =

Not all search indices work in all locales. It is the user’s responsibility to ensure that a given index is valid within a given locale.

According to the AWS documentation:

  • All searches through all indices.

  • Blended combines Apparel, Automotive, Books, DVD, Electronics, GourmetFood, Kitchen, Music, PCHardware, PetSupplies, Software, SoftwareVideoGames, SportingGoods, Tools, Toys, VHS and VideoGames.

  • Merchants combines all search indices for a merchant given with MerchantId.

  • Music combines the Classical, DigitalMusic, and MusicTracks indices.

  • Video combines the DVD and VHS search indices.

%w[
	All
	Apparel
	Automotive
	Baby
	Beauty
	Blended
	Books
	Classical
	DigitalMusic
	DVD
	Electronics
	ForeignBooks
	GourmetFood
	Grocery
	HealthPersonalCare
	Hobbies
	HomeGarden
	HomeImprovement
	Industrial
	Jewelry
	KindleStore
	Kitchen
	Lighting
	Magazines
	Merchants
	Miscellaneous
	MP3Downloads
	Music
	MusicalInstruments
	MusicTracks
	OfficeProducts
	OutdoorLiving
	Outlet
	PCHardware
	PetSupplies
	Photo
	Shoes
	SilverMerchants
	Software
	SoftwareVideoGames
	SportingGoods
	Tools
	Toys
	UnboxVideo
	VHS
	Video
	VideoGames
	Watches
	Wireless
	WirelessAccessories
]

Constants inherited from Operation

Operation::OPERATIONS

Instance Attribute Summary

Attributes inherited from Operation

#kind, #params, #response_group

Instance Method Summary collapse

Methods inherited from Operation

#batch, #query_parameters, #response_group_orig=

Constructor Details

#initialize(search_index, parameters) ⇒ ItemSearch

Search AWS for items. search_index must be one of SEARCH_INDICES and parameters is an optional hash of parameters that further refine the scope of the search.

Example:

is = ItemSearch.new( 'Books', { 'Title' => 'ruby programming' } )

In the above example, we search for books with Ruby Programming in the title.



952
953
954
955
956
957
958
# File 'lib/ruby-paa/aws.rb', line 952

def initialize(search_index, parameters)
	unless SEARCH_INDICES.include? search_index.to_s
	  raise "Invalid search index: #{search_index}"
	end

	super( { 'SearchIndex' => search_index }.merge( parameters ) )
end