org.carrot2.source.microsoft
Class Bing2WebDocumentSource

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.Bing2DocumentSource
                  extended by org.carrot2.source.microsoft.Bing2WebDocumentSource
All Implemented Interfaces:
IDocumentSource, IProcessingComponent

public class Bing2WebDocumentSource
extends Bing2DocumentSource

Web search specific document source fetching from Bing using Bing2 API.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.carrot2.source.microsoft.Bing2DocumentSource
Bing2DocumentSource.BingResponse, Bing2DocumentSource.ImageResponse, Bing2DocumentSource.ImageResult, Bing2DocumentSource.NewsResponse, Bing2DocumentSource.NewsResult, Bing2DocumentSource.Thumbnail, Bing2DocumentSource.WebResponse, Bing2DocumentSource.WebResult
 
Nested classes/interfaces inherited from class org.carrot2.source.MultipageSearchEngine
MultipageSearchEngine.SearchEngineResponseCallable, MultipageSearchEngine.SearchMode, MultipageSearchEngine.SearchRange
 
Field Summary
 String fileTypes
          Specify the allowed file types.
 String site
          Site restriction to return results under a given URL.
 String webOptions
          Miscellaneous Web-request specific options.
 
Fields inherited from class org.carrot2.source.microsoft.Bing2DocumentSource
adult, appid, CARROTSEARCH_APPID, market, MAX_CONCURRENT_THREADS, 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
Bing2WebDocumentSource()
          Initialize source type properly.
 
Method Summary
protected  void appendSourceParams(ArrayList<org.apache.http.NameValuePair> params)
          Append any source-specific parameters.
 void process()
          Process the query.
 
Methods inherited from class org.carrot2.source.microsoft.Bing2DocumentSource
addIfNotEmpty, createFetcher
 
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

webOptions

public String webOptions
Miscellaneous Web-request specific options. Bing provides the following options:

Options should be space-separated.

Attribute label:
Web request options
Attribute level:
Advanced
Attribute group:
Miscellaneous

fileTypes

public String fileTypes
Specify the allowed file types. Space-separated list of file extensions (upper-case). See Bing documentation.

Attribute label:
File types
Attribute level:
Advanced
Attribute group:
Results filtering

site

public String site
Site restriction to return results under a given URL. Example: http://www.wikipedia.com or simply wikipedia.com.

Attribute label:
Site restriction
Attribute level:
Advanced
Attribute group:
Results filtering
Constructor Detail

Bing2WebDocumentSource

public Bing2WebDocumentSource()
Initialize source type properly.

Method Detail

process

public void process()
             throws ProcessingException
Process the query.

Specified by:
process in interface IProcessingComponent
Specified by:
process in class Bing2DocumentSource
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.

appendSourceParams

protected void appendSourceParams(ArrayList<org.apache.http.NameValuePair> params)
Description copied from class: Bing2DocumentSource
Append any source-specific parameters.

Overrides:
appendSourceParams in class Bing2DocumentSource


Copyright (c) Dawid Weiss, Stanislaw Osinski