@Bindable(prefix="GoogleDocumentSource") public class GoogleDocumentSource extends MultipageSearchEngine
IDocumentSource fetching search results from Google JSON API. Please note
that this document source cannot deliver more than 32 search results.MultipageSearchEngine.SearchEngineResponseCallable, MultipageSearchEngine.SearchMode, MultipageSearchEngine.SearchRange| Modifier and Type | Field and Description |
|---|---|
boolean |
keepHighlights
Keep query word highlighting.
|
HttpRedirectStrategy |
redirectStrategy
HTTP redirect response strategy (follow or throw an error).
|
String |
referer
Request referrer.
|
String |
serviceUrl
Service URL.
|
searchModecompressed, documents, POSTPROCESSING, query, results, resultsTotal, SERVICE, start, statistics| Constructor and Description |
|---|
GoogleDocumentSource() |
| Modifier and Type | Method and Description |
|---|---|
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
Callable instance that
fetches search results in the given range. |
void |
process()
Performs the processing required to fulfill the request.
|
collectDocuments, process, runQueryclean, urlEncodeafterProcessing, beforeProcessing, dispose, getContext, getSharedExecutor, initclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafterProcessing, beforeProcessing, dispose, init@Input @Processing @Internal @Attribute @Label(value="Service URL") @Level(value=ADVANCED) @Group(value="Service") public String serviceUrl
@Input @Processing @Internal @Attribute @Label(value="Referrer") @Level(value=ADVANCED) @Group(value="Service") public String referer
@Input @Processing @Attribute @Label(value="Keep highlights") @Level(value=ADVANCED) @Group(value="Postprocessing") public boolean keepHighlights
true to keep these
highlights.@Input @Processing @Attribute @Label(value="HTTP redirect strategy") @Level(value=MEDIUM) @Group(value="Service") @Internal public HttpRedirectStrategy redirectStrategy
public void process()
throws ProcessingException
IProcessingComponentprocess 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)
MultipageSearchEngineCallable 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)
SearchEngineBaseafterFetch in class SearchEngineBase