com.yahoo.search
Class LocalSearchRequest

java.lang.Object
  extended by com.yahoo.rest.RestRequest
      extended by com.yahoo.search.LocalSearchRequest

public class LocalSearchRequest
extends RestRequest

Local search request object.

Author:
Ryan Kennedy

Constructor Summary
LocalSearchRequest(String query)
          Constructs a new local search request.
 
Method Summary
 void setCity(String city)
          City name.
 void setLatitude(String latitude)
          Sets the latitude of the local area to search.
 void setLocation(String location)
          Sets the location portion of the search as a string.
 void setLongitude(String longitude)
          Sets the longitude of the local area to search.
 void setQuery(String query)
           
 void setRadius(float radius)
          How far from the specified location to search for the query terms.
 void setResults(int results)
          The maximum number of results to return.
 void setSort(String sort)
          Sets the sort order for local search results.
 void setStart(BigInteger start)
          The starting result position.
 void setState(String state)
          The United States state.
 void setStreet(String street)
          Street name, the number is optional.
 void setZip(String zip)
          The five-digit zip code, or the five-digit code plus four-digit extension.
 
Methods inherited from class com.yahoo.rest.RestRequest
addParameter, clearParameter, getParameters, getRequestUrl, setParameter, setRequestUrl
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalSearchRequest

public LocalSearchRequest(String query)
Constructs a new local search request.

Parameters:
query - The query to search for. This is the only required attribute.
Method Detail

setQuery

public void setQuery(String query)

setResults

public void setResults(int results)
The maximum number of results to return. May return fewer results if there aren't enough results in the database. At the time of writing, the default value is 10, the maximum value is 50.

Parameters:
results - The maximum number of results to return.

setStart

public void setStart(BigInteger start)
The starting result position. This number should increment by the value of the results argument each time the user chooses the next page of results. The default is 1.

Parameters:
start - The starting result position.

setRadius

public void setRadius(float radius)
How far from the specified location to search for the query terms. The default radius varies according to the location given.

Parameters:
radius - How far from the specified location to search for the query terms.

setStreet

public void setStreet(String street)
Street name, the number is optional.

Parameters:
street - Street name, the number is optional.

setCity

public void setCity(String city)
City name.

Parameters:
city - City name.

setState

public void setState(String state)
The United States state. You can spell out the full state name or you can use the two-letter abbreviation.

Parameters:
state - The United States state.

setZip

public void setZip(String zip)
The five-digit zip code, or the five-digit code plus four-digit extension. If this location contradicts the city and state specified, the zip code takes priority.

Parameters:
zip - The five-digit zip code, or the five-digit code plus four-digit extension.

setLocation

public void setLocation(String location)
Sets the location portion of the search as a string. This free field lets users enter any of the following:

Parameters:
location - Free text location field.

setLatitude

public void setLatitude(String latitude)
Sets the latitude of the local area to search.

Parameters:
latitude - The latitude of the local area to search.

setLongitude

public void setLongitude(String longitude)
Sets the longitude of the local area to search.

Parameters:
longitude - The longitude of the local area to search.

setSort

public void setSort(String sort)
Sets the sort order for local search results. The options at the time of writing are "distance", "rating" and "name", while the default value is to sort by relevance.

Parameters:
sort - The sort order for local search results.