org.carrot2.source.microsoft
Class MicrosoftLiveDocumentSource

java.lang.Object
  extended by org.carrot2.core.ProcessingComponentBase
      extended by org.carrot2.source.SearchEngineBase
          extended by org.carrot2.source.MultipageSearchEngine
              extended by org.carrot2.source.microsoft.MicrosoftLiveDocumentSource
All Implemented Interfaces:
IDocumentSource, IProcessingComponent

public final class MicrosoftLiveDocumentSource
extends MultipageSearchEngine

A IDocumentSource fetching Documents (search results) from Microsoft Live!.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.carrot2.source.MultipageSearchEngine
MultipageSearchEngine.SearchEngineResponseCallable, MultipageSearchEngine.SearchMode, MultipageSearchEngine.SearchRange
 
Field Summary
 String appid
          Microsoft-assigned application ID for querying the API.
static String CARROTSEARCH_APPID
          Application ID assigned to Carrot Search s.c.
 CultureInfo culture
          Culture and language restriction.
 SafeSearch safeSearch
          Safe search restriction (porn filter).
 
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
MicrosoftLiveDocumentSource()
           
 
Method Summary
protected  Callable<SearchEngineResponse> createFetcher(MultipageSearchEngine.SearchRange bucket)
          Create a single page fetcher for the search range.
 void process()
          Run a single query.
 
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

CARROTSEARCH_APPID

public static final String CARROTSEARCH_APPID
Application ID assigned to Carrot Search s.c.

See Also:
Constant Field Values

appid

public String appid
Microsoft-assigned application ID for querying the API. Please generate your own ID for production deployments and branches off the Carrot2.org's code.

Attribute label:
Application ID
Attribute level:
Advanced
Attribute group:
Service

culture

public CultureInfo culture
Culture and language restriction.

Attribute label:
Culture
Attribute level:
Medium
Attribute group:
Results filtering

safeSearch

public SafeSearch safeSearch
Safe search restriction (porn filter).

Attribute label:
Safe Search
Attribute level:
Medium
Attribute group:
Results filtering
Constructor Detail

MicrosoftLiveDocumentSource

public MicrosoftLiveDocumentSource()
Method Detail

process

public void process()
             throws ProcessingException
Run a single query.

Specified by:
process in interface IProcessingComponent
Overrides:
process in class ProcessingComponentBase
Throws:
ProcessingException - 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.

createFetcher

protected final Callable<SearchEngineResponse> createFetcher(MultipageSearchEngine.SearchRange bucket)
Create a single page fetcher for the search range.

Specified by:
createFetcher in class MultipageSearchEngine
Parameters:
bucket - The search range to fetch.


Copyright (c) Dawid Weiss, Stanislaw Osinski