public abstract class VespaBackEndSearcher extends PingableSearcher
Modifier and Type | Class and Description |
---|---|
protected static class |
VespaBackEndSearcher.FillHitsResult |
Modifier and Type | Field and Description |
---|---|
protected CacheControl |
cacheControl
Cache wrapper
|
protected static com.yahoo.processing.request.CompoundName |
TRACE_DISABLE |
Constructor and Description |
---|
VespaBackEndSearcher() |
Modifier and Type | Method and Description |
---|---|
protected QueryPacket |
createQueryPacket(Query query) |
protected abstract void |
doPartialFill(Result result,
String summaryClass) |
protected abstract Result |
doSearch2(Query query,
QueryPacket queryPacket,
CacheKey cacheKey,
Execution execution)
Searches a search cluster
This is an endpoint - searchers will never propagate the search to any nested searcher.
|
void |
fill(Result result,
String summaryClass,
Execution execution)
Fill hit properties with data using the given summary class.
|
VespaBackEndSearcher.FillHitsResult |
fillHits(Result result,
Packet[] packets,
String summaryClass)
Fills the hits.
|
CacheControl |
getCacheControl()
Returns the packet cache controller of this
|
protected String |
getDefaultDocsumClass() |
protected DocsumDefinitionSet |
getDocsumDefinitionSet(Query query) |
protected DocumentDatabase |
getDocumentDatabase(Query query) |
Logger |
getLogger()
Returns a logger unique for the instance subclass
|
String |
getName() |
static VespaBackEndSearcher |
getSearcher(String s) |
void |
init(SummaryParameters docSumParams,
ClusterParams clusterParams,
CacheParams cacheParams,
DocumentdbInfoConfig documentdbInfoConfig) |
protected boolean |
isLoggingFine() |
Result |
search(Query query,
Execution execution)
Override this to implement your searcher.
|
boolean |
summaryNeedsQuery(Query query)
Returns whether we need to send the query when fetching summaries.
|
protected void |
transformQuery(Query query) |
ping
ensureFilled, process, toString
getAnnotatedDependencies, getDefaultAnnotatedDependencies, getDependencies, initDependencies
protected static final com.yahoo.processing.request.CompoundName TRACE_DISABLE
protected CacheControl cacheControl
public final String getName()
protected final String getDefaultDocsumClass()
public final CacheControl getCacheControl()
public final Logger getLogger()
Searcher
protected abstract Result doSearch2(Query query, QueryPacket queryPacket, CacheKey cacheKey, Execution execution)
query
- the query to searchqueryPacket
- the serialized query representation to pass to the search clustercacheKey
- the cache key created from the query packet, or null if caching is not usedexecution
- the query execution contextpublic boolean summaryNeedsQuery(Query query)
protected DocumentDatabase getDocumentDatabase(Query query)
public final void init(SummaryParameters docSumParams, ClusterParams clusterParams, CacheParams cacheParams, DocumentdbInfoConfig documentdbInfoConfig)
protected void transformQuery(Query query)
public Result search(Query query, Execution execution)
Searcher
Searcher implementation subclasses will, depending on their type of logic, do one of the following:
Hits come in two kinds - concrete hits are actual content of the kind requested by the user, meta hits are hits which provides information about the collection of hits, on the query, the service and so on.
The query specifies a window into a larger result list that must be returned from the searcher through hits and offset; Searchers which returns list of hits in the top level in the result must return at least hits number of hits (or if impossible; all that are available), starting at the given offset. In addition, searchers are allowed to return any number of meta hits (although this number is expected to be low). For hits contained in nested hit groups, the concept of a window defined by hits and offset is not well defined and does not apply.
Error handling in searchers:
protected QueryPacket createQueryPacket(Query query)
public void fill(Result result, String summaryClass, Execution execution)
Searcher
This needs to be overridden by federating searchers to contact search sources again by propagating the fill call down through the search chain, and by source searchers which talks to fill capable backends to request the data to be filled. Other searchers do not need to override this.
public VespaBackEndSearcher.FillHitsResult fillHits(Result result, Packet[] packets, String summaryClass) throws IOException
IOException
protected DocsumDefinitionSet getDocsumDefinitionSet(Query query)
public static VespaBackEndSearcher getSearcher(String s)
protected boolean isLoggingFine()
Copyright © 2018. All rights reserved.