org.carrot2.source
Class SimpleSearchEngine

java.lang.Object
  extended by org.carrot2.core.ProcessingComponentBase
      extended by org.carrot2.source.SearchEngineBase
          extended by org.carrot2.source.SimpleSearchEngine
All Implemented Interfaces:
IDocumentSource, IProcessingComponent
Direct Known Subclasses:
PubMedDocumentSource, RemoteXmlSimpleSearchEngineBase

public abstract class SimpleSearchEngine
extends SearchEngineBase

A base class facilitating implementation of IDocumentSources wrapping external search engines with remote/ network-based interfaces. This implementation assumes that all requested results can be fetched from the search engine using one request.

See Also:
MultipageSearchEngine

Field Summary
 
Fields inherited from class org.carrot2.source.SearchEngineBase
compressed, documents, query, results, resultsTotal, start, statistics
 
Constructor Summary
SimpleSearchEngine()
           
 
Method Summary
protected abstract  SearchEngineResponse fetchSearchResponse()
          Requests and returns results from the underlying search engine.
 void process()
          Performs the processing required to fulfill the request.
 
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
 

Constructor Detail

SimpleSearchEngine

public SimpleSearchEngine()
Method Detail

fetchSearchResponse

protected abstract SearchEngineResponse fetchSearchResponse()
                                                     throws Exception
Requests and returns results from the underlying search engine.

Throws:
Exception - in case of problems with the underlying search engine

process

public void process()
             throws ProcessingException
Description copied from interface: IProcessingComponent
Performs the processing required to fulfill the request. This method is called once per request.

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.


Copyright (c) Dawid Weiss, Stanislaw Osinski