SearchVisitor design

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.

Initiation

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:

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.

SearchResult

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.

DocumentSummary

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.

AggregationResult

This is the message returned containing the aggregation data. They follow the format of the aggregation packet used in the fs4 protocol.