org.carrot2.source.boss
Class BossWebSearchService

java.lang.Object
  extended by org.carrot2.source.boss.BossSearchService
      extended by org.carrot2.source.boss.BossWebSearchService

public final class BossWebSearchService
extends BossSearchService

Sends queries to Yahoo! Boss Web search service. Instances of this class are thread-safe.

Attributes of this class correspond to Yahoo's documentation (see links below).

See Also:
API description, Yahoo Boss Documentation
Attribute label:
Yahoo Boss Web Search Service

Nested Class Summary
static class BossWebSearchService.OffensiveContentFilter
          Constants for offensive content filtering.
 
Field Summary
 BossWebSearchService.OffensiveContentFilter filter
          Filters out adult or hate content.
 String serviceURI
          Boss Web search service URI.
 String type
          Restricts search to documents of the specified types.
 
Fields inherited from class org.carrot2.source.boss.BossSearchService
appid, CARROTSEARCH_APPID, languageAndRegion, logger, metadata, sites, YBOSS_RESPONSE
 
Constructor Summary
BossWebSearchService()
           
 
Method Summary
protected  ArrayList<org.apache.commons.httpclient.NameValuePair> createRequestParams(String query, int start, int results)
          Assembles an array of NameValuePair with request parameters.
protected  String getServiceURI()
           
 
Methods inherited from class org.carrot2.source.boss.BossSearchService
query
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serviceURI

public String serviceURI
Boss Web search service URI. Specifies the URI at which Yahoo Boss Web Search API is available. The ${query} place holder will be replaced with the URL-encoded text of the processed query.

Attribute label:
Service URI
Attribute level:
Advanced
Attribute group:
Service

filter

public BossWebSearchService.OffensiveContentFilter filter
Filters out adult or hate content. Must be a comma-separated list of content types to filter out.

The following content types are supported:

Value Content
-porn Filters out adult content
-hate Filters out hate content

Adult content filtering is supported for all languages, hate content filtering is supported for English only.

Attribute label:
Content filter
Attribute level:
Medium
Attribute group:
Results filtering

type

public String type
Restricts search to documents of the specified types. Must be a comma-separated list of the required document types or type groups.

The following document types are supported:

Value Document type
html HTML documents
text Plain text documents
pdf Portable Document Format documents
xl Microsoft Excel documents
msword Microsoft Word documents
ppt Microsoft Power Point documents

The following document type groups are supported:

Value Document type groups
msoffice All Microsoft Office documents (xl, msword, ppt)
nohtml Anything else than HTML documents (text, pdf, xl, msword, ppt)

You can also specify a format group and then exclude an item: type=msoffice,-ppt.

Attribute label:
Type filter
Attribute level:
Advanced
Attribute group:
Results filtering
Constructor Detail

BossWebSearchService

public BossWebSearchService()
Method Detail

createRequestParams

protected ArrayList<org.apache.commons.httpclient.NameValuePair> createRequestParams(String query,
                                                                                     int start,
                                                                                     int results)
Assembles an array of NameValuePair with request parameters.

Specified by:
createRequestParams in class BossSearchService

getServiceURI

protected String getServiceURI()
Specified by:
getServiceURI in class BossSearchService
Returns:
Return service URI for this service.


Copyright (c) Dawid Weiss, Stanislaw Osinski