Amazon CloudSearch
Developer Guide (API Version 2011-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Making Search Requests in Amazon CloudSearch

The search API is a REST-style API that has a single resource, search. You submit search requests to your domain's unique search service endpoint. Search requests are HTTP requests, as defined by RFC 2616. Search requests must be submitted using HTTP GET.

You must specify the Amazon CloudSearch API version in every search request. The current Amazon CloudSearch API version is 2011-02-01. The version number precedes the resource name in the request, for example GET /2011-02-01/search.

Access Control

Access to a search domain's search service is restricted by IP address so that only authorized hosts can submit search requests. By default, your domain will not accept search requests from any IP addresses. You have to authorize specific IP addresses or address ranges before you can search the domain. You can do this from the Amazon CloudSearch console, through the cs-configure-access-policies command, or with the UpdateServiceAccessPolicies configuration action.

Request Headers

A search request must include the HOST header, which specifies your domain's search service endpoint.

Optionally, you can also specify the following headers:

  • Cache-Control—forces the revalidation of results when a cached result document would otherwise be returned.

By default, the response to a search request is returned in JSON. You can set the Accept header to application/xml if you want an XML response.

Request Parameters

Search parameters are specified in the query string. For more information about constructing searches, see Searching Your Data with Amazon CloudSearch.

Example Request

GET /2011-02-01/search?q=star+wars&return-fields=title HTTP/1.1
Host: search-imdb-movies-rr2f34ofg56xneuemujamut52i.us-east-1.cloudsearch.amazonaws.com