com.yahoo.search
Class ContextSearchRequest

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

public class ContextSearchRequest
extends RestRequest

Context search request object.

Author:
Ryan Kennedy

Constructor Summary
ContextSearchRequest(String context)
          Constructs a new image search request.
 
Method Summary
 void addLicense(String license)
          The Creative Commons license that the contents are licensed under.
 void setAdultOk(boolean adultOk)
          Specifies if adult related results are permitted.
 void setContext(String context)
          The context to extract meaning from.
 void setCountry(String country)
          The country code for the country the website is located in.
 void setFormat(String format)
          Specifies the kind of content to search for.
 void setLanguage(String language)
          The language the results are written in.
 void setQuery(String query)
          The query to search for.
 void setResults(int results)
          The maximum number of results to return.
 void setSimilarOk(boolean similarOk)
          Specifies whether to allow multiple results with similar content.
 void setStart(int start)
          The starting result position.
 void setType(String type)
          Sets the type of the search.
 
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

ContextSearchRequest

public ContextSearchRequest(String context)
Constructs a new image search request.

Parameters:
context - The context to extract meaning from. This is the only required attribute.
Method Detail

setContext

public void setContext(String context)
The context to extract meaning from.

Parameters:
context - The context to extract meaning from.

setQuery

public void setQuery(String query)
The query to search for.

Parameters:
query - The query to search for.

setType

public void setType(String type)
Sets the type of the search. At the time of writing, three options are available:

Parameters:
type - The type of search to execute.

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(int 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.

setFormat

public void setFormat(String format)
Specifies the kind of content to search for. At the time of writing, the following options are available: any, html, msword, pdf, ppt, rss, txt and xls.

Parameters:
format - Specifies the kind of content to search for.

setAdultOk

public void setAdultOk(boolean adultOk)
Specifies if adult related results are permitted. Defaults to false.

Parameters:
adultOk - Specifies if adult related results are permitted.

setSimilarOk

public void setSimilarOk(boolean similarOk)
Specifies whether to allow multiple results with similar content.

Parameters:
similarOk - Specifies whether to allow multiple results with similar content.

setLanguage

public void setLanguage(String language)
The language the results are written in.

Parameters:
language - The language the results are written in.

setCountry

public void setCountry(String country)
The country code for the country the website is located in.

Parameters:
country - The country code for the country the website is located in.

addLicense

public void addLicense(String license)
The Creative Commons license that the contents are licensed under. You may submit multiple values.

Parameters:
license - The Creative Commons license that the contents are licensed under. You may submit multiple values.