@Bindable(prefix="SearchEngineBase", inherit=CommonAttributes.class) public abstract class SearchEngineBase extends ProcessingComponentBase implements IDocumentSource
IDocumentSource
s wrapping external
search engines with remote/ network-based interfaces. The base class defines the common
attribute fields used by more specific base classes and concrete implementations.SimpleSearchEngine
,
MultipageSearchEngine
Modifier and Type | Field and Description |
---|---|
boolean |
compressed
Indicates whether the search engine returned a compressed result stream.
|
Collection<Document> |
documents |
protected static String |
POSTPROCESSING
Group name. |
String |
query |
int |
results |
long |
resultsTotal |
static String |
SERVICE
Group name. |
int |
start |
SearchEngineStats |
statistics
This component usage statistics.
|
Constructor and Description |
---|
SearchEngineBase() |
Modifier and Type | Method and Description |
---|---|
protected void |
afterFetch(SearchEngineResponse response)
Called after a single search engine response has been fetched.
|
protected static void |
clean(SearchEngineResponse response,
boolean keepHighlights,
String... fields)
Unescape HTML entities and tags from a given set of
fields of all
documents in the provided response . |
protected static String |
urlEncode(String string)
URL-encodes a string into UTF-8.
|
afterProcessing, beforeProcessing, dispose, getContext, getSharedExecutor, init, process
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterProcessing, beforeProcessing, dispose, init, process
public static final String SERVICE
Group
name.protected static final String POSTPROCESSING
Group
name.@Processing @Input @Attribute(key="start", inherit=true) @IntRange(min=0) public int start
@Processing @Input @Attribute(key="results", inherit=true) @IntRange(min=1) public int results
@Processing @Input @Attribute(key="query", inherit=true) @Required public String query
@Processing @Output @Attribute(key="results-total", inherit=true) public long resultsTotal
@Processing @Output @Attribute(key="documents", inherit=true) @Internal public Collection<Document> documents
@Processing @Output @Attribute @Label(value="Compression used") @Group(value="Search result information") public boolean compressed
public SearchEngineStats statistics
protected static void clean(SearchEngineResponse response, boolean keepHighlights, String... fields)
fields
of all
documents in the provided response
.response
- the search engine response to cleankeepHighlights
- set to true
to keep query terms highlightsfields
- names of fields to cleanprotected void afterFetch(SearchEngineResponse response)