org.carrot2.source.pubmed
Class PubMedDocumentSource

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

public class PubMedDocumentSource
extends SimpleSearchEngine

Performs searches on the PubMed database using its on-line e-utilities: http://eutils.ncbi.nlm.nih.gov/entrez/query/static/eutils_help.html


Field Summary
static String E_FETCH_URL
          PubMed fetch service URL
static String E_SEARCH_URL
          PubMed search service URL
 int maxResults
          Maximum results to fetch.
static int PUBMED_TIMEOUT
          HTTP timeout for pubmed services.
 
Fields inherited from class org.carrot2.source.SearchEngineBase
compressed, documents, query, results, resultsTotal, start, statistics
 
Constructor Summary
PubMedDocumentSource()
           
 
Method Summary
protected  void afterFetch(SearchEngineResponse response)
          Called after a single search engine response has been fetched.
protected  SearchEngineResponse fetchSearchResponse()
          Requests and returns results from the underlying search engine.
 
Methods inherited from class org.carrot2.source.SimpleSearchEngine
process
 
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

E_SEARCH_URL

public static final String E_SEARCH_URL
PubMed search service URL

See Also:
Constant Field Values

E_FETCH_URL

public static final String E_FETCH_URL
PubMed fetch service URL

See Also:
Constant Field Values

PUBMED_TIMEOUT

public static final int PUBMED_TIMEOUT
HTTP timeout for pubmed services.

See Also:
Constant Field Values

maxResults

public int maxResults
Maximum results to fetch. No more than the specified number of results will be fetched from PubMed, regardless of the requested number of results.

Attribute label:
Maximum results
Attribute level:
ADVANCED
Attribute group:
Search query
Constructor Detail

PubMedDocumentSource

public PubMedDocumentSource()
Method Detail

fetchSearchResponse

protected SearchEngineResponse fetchSearchResponse()
                                            throws Exception
Description copied from class: SimpleSearchEngine
Requests and returns results from the underlying search engine.

Specified by:
fetchSearchResponse in class SimpleSearchEngine
Throws:
Exception - in case of problems with the underlying search engine

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