|
Carrot2 v3.6.0-SNAPSHOT
API Documentation |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.carrot2.core.ProcessingComponentBase
org.carrot2.source.SearchEngineBase
org.carrot2.source.MultipageSearchEngine
org.carrot2.source.google.GoogleDocumentSource
public class GoogleDocumentSource
A IDocumentSource fetching search results from Google JSON API. Please note
that this document source cannot deliver more than 32 search results.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.carrot2.source.MultipageSearchEngine |
|---|
MultipageSearchEngine.SearchEngineResponseCallable, MultipageSearchEngine.SearchMode, MultipageSearchEngine.SearchRange |
| Field Summary | |
|---|---|
boolean |
keepHighlights
Keep query word highlighting. |
String |
referer
Request referer. |
String |
serviceUrl
Service URL. |
| 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 | |
|---|---|
GoogleDocumentSource()
|
|
| Method Summary | |
|---|---|
protected void |
afterFetch(SearchEngineResponse response)
Called after a single search engine response has been fetched. |
protected Callable<SearchEngineResponse> |
createFetcher(MultipageSearchEngine.SearchRange bucket)
Subclasses should override this method and return a MultipageSearchEngine.SearchEngineResponseCallable instance that
fetches search results in the given range. |
void |
process()
Performs the processing required to fulfill the request. |
| 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 |
|---|
public String serviceUrl
public String referer
public boolean keepHighlights
true to keep these
highlights.
| Constructor Detail |
|---|
public GoogleDocumentSource()
| Method Detail |
|---|
public void process()
throws ProcessingException
IProcessingComponent
process in interface IProcessingComponentprocess in class ProcessingComponentBaseProcessingException - 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.protected Callable<SearchEngineResponse> createFetcher(MultipageSearchEngine.SearchRange bucket)
MultipageSearchEngineMultipageSearchEngine.SearchEngineResponseCallable instance that
fetches search results in the given range.
Note the query (if any is required) should be passed at the concrete class level. We are not concerned with it here.
createFetcher in class MultipageSearchEnginebucket - The search range to fetch.protected void afterFetch(SearchEngineResponse response)
SearchEngineBase
afterFetch in class SearchEngineBase
|
Please refer to project documentation at
http://project.carrot2.org |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||