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 |
PACKET_COMPRESSION_LIMIT |
protected static com.yahoo.processing.request.CompoundName |
PACKET_COMPRESSION_TYPE |
protected static com.yahoo.processing.request.CompoundName |
TRACE_DISABLE |
Constructor and Description |
---|
VespaBackEndSearcher() |
Modifier and Type | Method and Description |
---|---|
protected void |
addMetaInfo(Query query,
QueryPacketData queryPacketData,
QueryResultPacket resultPacket,
Result result,
boolean fromCache) |
protected PacketWrapper |
cacheLookupTwoPhase(CacheKey cacheKey,
Result result,
String summaryClass) |
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.
|
protected static void |
ensureInstanceOf(Class<? extends BasicPacket> type,
BasicPacket packet,
String name)
Throws an IOException if the packet is not of the expected type
|
void |
fill(Result result,
String summaryClass,
Execution execution)
Fill hit properties with data using the given summary class.
|
protected 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) |
protected String |
getName() |
static VespaBackEndSearcher |
getSearcher(String s) |
protected Iterator<Hit> |
hitIterator(Result result)
Returns an iterator which returns all hits below this result
|
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.
|
protected boolean |
summaryNeedsQuery(Query query)
Returns whether we need to send the query when fetching summaries.
|
protected void |
transformQuery(Query query) |
ping
ensureFilled, getLogger, process, toString
getAnnotatedDependencies, getDefaultAnnotatedDependencies, getDependencies, initDependencies
protected static final com.yahoo.processing.request.CompoundName PACKET_COMPRESSION_LIMIT
protected static final com.yahoo.processing.request.CompoundName PACKET_COMPRESSION_TYPE
protected static final com.yahoo.processing.request.CompoundName TRACE_DISABLE
protected CacheControl cacheControl
protected Iterator<Hit> hitIterator(Result result)
protected final String getName()
protected final String getDefaultDocsumClass()
public final CacheControl getCacheControl()
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 contextprotected 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:
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.
protected void addMetaInfo(Query query, QueryPacketData queryPacketData, QueryResultPacket resultPacket, Result result, boolean fromCache)
protected VespaBackEndSearcher.FillHitsResult fillHits(Result result, Packet[] packets, String summaryClass) throws IOException
IOException
protected static void ensureInstanceOf(Class<? extends BasicPacket> type, BasicPacket packet, String name) throws IOException
IOException
protected PacketWrapper cacheLookupTwoPhase(CacheKey cacheKey, Result result, String summaryClass)
protected DocsumDefinitionSet getDocsumDefinitionSet(Query query)
public static VespaBackEndSearcher getSearcher(String s)
protected boolean isLoggingFine()
Copyright © 2018. All rights reserved.