org.carrot2.source.boss
Class BossDocumentSource

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.boss.BossDocumentSource
All Implemented Interfaces:
IDocumentSource, IProcessingComponent

public final class BossDocumentSource
extends MultipageSearchEngine

A IDocumentSource fetching Documents (search results) from Yahoo BOSS.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.carrot2.source.MultipageSearchEngine
MultipageSearchEngine.SearchEngineResponseCallable, MultipageSearchEngine.SearchMode, MultipageSearchEngine.SearchRange
 
Field Summary
 boolean keepHighlights
          Determines whether to keep the original query word highlights.
 BossSearchService service
          The specific search service to be used by this document source.
 
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
BossDocumentSource()
           
 
Method Summary
protected  void afterFetch(SearchEngineResponse response)
          Called after a single search engine response has been fetched.
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
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

keepHighlights

public boolean keepHighlights
Determines whether to keep the original query word highlights. Yahoo by default highlights query words in search results using the <b> HTML tag. Set this attribute to true to keep these highlights.

Attribute label:
Keep highlights
Attribute level:
Advanced
Attribute group:
Postprocessing

service

public BossSearchService service
The specific search service to be used by this document source. Use this attribute to choose which BOSS's service to query, e.g. Web, News or Image search.

Attribute label:
Boss Search Service
Attribute level:
Advanced
Attribute group:
Service
Constructor Detail

BossDocumentSource

public BossDocumentSource()
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.

afterFetch

protected void afterFetch(SearchEngineResponse response)
Description copied from class: SearchEngineBase
Called after a single search engine response has been fetched. The concrete implementation may want to override this empty implementation to e.g., clean or otherwise postprocess the returned results.

Overrides:
afterFetch in class SearchEngineBase


Copyright (c) Dawid Weiss, Stanislaw Osinski