The SearchVisitor is a visitor plugin running in the storaged binary. It processes queries and docsum requests and returns SearchResult and DocumentSummary objects to the client. It uses Vespa Streaming Matcher (VSM) to generate the search results and document summaries.
Since the distributors in VDS do not have dispatch capability, that is implemented in the QRS(client). It must collect all messages received, merge them and present them to its liking.
The client sends down a createVisitor command with the following parameters set:
Timeout : This is the query timeout.
VisitorLibrary: "SearchVisitor". Tells the framework to use the SearchVisitor visitor plugin, rather than the default DumpVisitor.
VisitorParameters: Containing the following arguments for the SearchVisitor:
"query": The raw encoded query stack from QRS. It has the same format as the query parameter in the QueryPacket sent to indexed search.
"searchcluster": This identifies which searchcluster is queried. The visitor uses this to choose the correct config.
"summaryclass": Which summaryclass is wanted.
"summarycount": The number of summaries wanted.
"aggregation": The aggregation specification as specified by the fs4 protocol. The aggregation options are the same as for indexed search.
"sort": The sort specification as specified by the fs4 protocol.
"unique": The field to do duplicate removal on.
"rankprofile": Which rank profile to use. The default is 0.
"rankproperties": A set of properties to use in ranking for the backend.
The backend will return all hits, but only the requested number of summaries. It is the client's responsibility to handle "hits" and "offset" query parameters.
Only singlephase has been implemented as all the data are available anyway.
"aggregate", "sort" and "unique" are not limited to attributes as they are in indexed search. Every field has attribute semantics in streamed search.
This is the message returned to the client after the search has been conducted.
It contains a list of Hits each containing the documentid as known by VDS, and a rank identifying the relevance of the document with respect to the query. The list is sorted on descending rank.
This is the message returned to the client after all the document summaries have been generated.
It contains a list of Summary objects, each containing the documentId as known by VDS and the summary blob. The list is sorted on ascending docid. The summary blob is encoded as specified by the fastserver4 protocol.
This is the message returned containing the aggregation data. They follow the format of the aggregation packet used in the fs4 protocol.