Search Indices
One of the reasons that customers enjoy shopping on Amazon is that Amazon has hundreds of thousands of items for sale—far more than any one store could contain. On Amazon, you can find just about anything—from a book to a $100,000 piece of jewelry. Ironically, the job of finding the items you want to buy is made more difficult by having so many items for sale. Returning too many items in a response is almost as bad as returning no items at all. Amazon addresses this difficulty by placing every item it sells into a product category, called a search index.
You can think of search indices as dividing into groups everything for sale on Amazon, as shown in the following figure.
By selecting one slice in a request , you avoid returning items in all of the other slices. This functionality makes requests more targeted and reduces search times. For example, when looking for a specific book, it is best to specify the Books search index in the request.
SearchIndex=Books
Titles and keywords used to find items often occur in multiple search indices. For example, if you were searching using "Harry%20Potter" as your keyword, you would get results in many search indices, including Books, DVD, Video, and Music.By specifying the search index you are interested in, your request becomes much better targeted.
Specifying the wrong search index leads to no results or results that do not meet the customer's search criteria. For example, if your keyword was carburetor and the search index was Kitchen, you might not get any items that match the search criteria. Change the search index to Automotive and you'd get many matches.
Amazon uses the following search indices to divide up all of the items for sale.
|
|
|
Combined Search Indices
As a convenience, some of the search indices are combinations of other search indices, for example:
-
All—Searches through all search indices. Only five pages of items can be returned where each page contains up to five items
-
Blended—Combines the following search indices: DVD, Electronics, Toys, VideoGames, PCHardware, Tools, SportingGoods, Books, Software, Music, GourmetFood, Kitchen, and Apparel search indices
-
Merchants—Returns the items across all search indices for a merchant who is specified by a value for MerchantId
-
Music—Combines Classical, DigitalMusic, and MusicTracks search indices
-
Video—Combines DVD and VHS search indices
These search index combinations are helpful when you are not sure which search index to specify. The downside of using one of these combined search indices is that they might return quite a few items in the response.
More commonly, you will specify individual search indices in requests, for example,
http://ecs.amazonaws.com/onca/xml? Service=AWSECommerceService& AWSAccessKeyId=[AWS Access Key ID]
& Operation=ItemSearch
& Condition=All& ResponseGroup=Images& SearchIndex=Books& Title=Harry%20Potter
All Search Index
Note | |
---|---|
The list of all available search indexes by locale can be found on the search indexes page. |
Merchants Search Index
Because the Merchants search index bases its search on a specific merchant,
the request must include a value for MerchantId
, as shown
in the following request.
http://ecs.amazonaws.com/onca/xml? Service=AWSECommerceService& AWSAccessKeyId=[AWS Access Key ID]
& Operation=ItemSearch
& SearchIndex=Merchants& MerchantId=A363XKZVKSMVXW& Keywords=the& Version=2006-09-13
The following response snippet shows items returned from different search indices.
<Item> <ASIN>B000DZJNRS</ASIN> ... <ItemAttributes> <Manufacturer>SportVideos.com</Manufacturer> <ProductGroup>DVD</ProductGroup> <Title>Play Better Volleyball: Setting</Title> </ItemAttributes> </Item> <Item> <ASIN>B00006A6W0</ASIN> ... <ItemAttributes> <Manufacturer>Bennett Media Corpor</Manufacturer> <ProductGroup>Video</ProductGroup> <Title>Garmin Rino 110/120 GPS/ 2 Way Radio Instructional Video</Title> </ItemAttributes> </Item>