|
Carrot2 v3.6.0-SNAPSHOT
API Documentation |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.carrot2.core.ProcessingComponentBase
org.carrot2.source.SearchEngineBase
org.carrot2.source.MultipageSearchEngine
org.carrot2.source.microsoft.Bing2DocumentSource
public abstract class Bing2DocumentSource
A base IDocumentSource serving requests to Microsoft Bing API, version 2. We model
this into separate subclasses, specific to a particular request type (web, image, news). In
theory one could request web and news results at once, but in practice this is difficult
when paging is also needed (because they have different limits).
| Nested Class Summary | |
|---|---|
static class |
Bing2DocumentSource.BingResponse
|
static class |
Bing2DocumentSource.ImageResponse
|
static class |
Bing2DocumentSource.ImageResult
|
static class |
Bing2DocumentSource.NewsResponse
|
static class |
Bing2DocumentSource.NewsResult
|
static class |
Bing2DocumentSource.Thumbnail
|
static class |
Bing2DocumentSource.WebResponse
|
static class |
Bing2DocumentSource.WebResult
|
| Nested classes/interfaces inherited from class org.carrot2.source.MultipageSearchEngine |
|---|
MultipageSearchEngine.SearchEngineResponseCallable, MultipageSearchEngine.SearchMode, MultipageSearchEngine.SearchRange |
| Field Summary | |
|---|---|
AdultOption |
adult
Adult search restriction (porn filter). |
String |
appid
Microsoft-assigned application ID for querying the API. |
static String |
CARROTSEARCH_APPID
Application ID assigned to Carrot Search s.c. |
MarketOption |
market
Language and country/region information for the request. |
protected static int |
MAX_CONCURRENT_THREADS
Maximum concurrent threads from all instances of this subcomponents sending requests to Bing. |
String |
options
Miscellaneous request options. |
| Fields inherited from class org.carrot2.source.MultipageSearchEngine |
|---|
searchMode |
| Fields inherited from class org.carrot2.source.SearchEngineBase |
|---|
compressed, documents, query, results, resultsTotal, start, statistics |
| Constructor Summary | |
|---|---|
Bing2DocumentSource(SourceType sourceType)
Initialize with a fixed source type. |
|
| Method Summary | |
|---|---|
protected void |
addIfNotEmpty(ArrayList<org.apache.http.NameValuePair> params,
String paramName,
Object value)
Add a parameter if argument is not an empty string. |
protected void |
appendSourceParams(ArrayList<org.apache.http.NameValuePair> params)
Append any source-specific parameters. |
protected Callable<SearchEngineResponse> |
createFetcher(MultipageSearchEngine.SearchRange bucket)
Create a single page fetcher for the search range. |
abstract void |
process()
Make this abstract so that subclasses override. |
| Methods inherited from class org.carrot2.source.MultipageSearchEngine |
|---|
collectDocuments, process, runQuery |
| Methods inherited from class org.carrot2.source.SearchEngineBase |
|---|
afterFetch, clean, urlEncode |
| Methods inherited from class org.carrot2.core.ProcessingComponentBase |
|---|
afterProcessing, beforeProcessing, dispose, getContext, getSharedExecutor, init |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.carrot2.core.IProcessingComponent |
|---|
afterProcessing, beforeProcessing, dispose, init |
| Field Detail |
|---|
public static final String CARROTSEARCH_APPID
protected static final int MAX_CONCURRENT_THREADS
public String appid
public MarketOption market
public AdultOption adult
public String options
Options should be space-separated.
| Constructor Detail |
|---|
public Bing2DocumentSource(SourceType sourceType)
| Method Detail |
|---|
protected final Callable<SearchEngineResponse> createFetcher(MultipageSearchEngine.SearchRange bucket)
createFetcher in class MultipageSearchEnginebucket - The search range to fetch.
protected void addIfNotEmpty(ArrayList<org.apache.http.NameValuePair> params,
String paramName,
Object value)
public abstract void process()
throws ProcessingException
process in interface IProcessingComponentprocess in class ProcessingComponentBaseProcessingException - when processing failed. If thrown, the
IProcessingComponent.afterProcessing() method will be called and the component will
be ready to accept further requests or to be disposed of. Finally, the
exception will be rethrown from the controller method that caused the
component to perform processing.protected void appendSourceParams(ArrayList<org.apache.http.NameValuePair> params)
|
Please refer to project documentation at
http://project.carrot2.org |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||