insights: new streaming search decoder to use with aggregation of search results
Created by: chwarwick
Adds a new decoder that can be used for aggregations. The decoder itself does not have any logic related to aggregations aside from an indicator if lucky search was triggered and could in the future support the other cases where we call streaming search.
The TabulateAggregationMatches
function returns an OnMatch function to execute on individual results. It will pre-aggregate results with the within the batch but the final aggregations will be handled by the provided tabulator
function. The goal here was so this could support both just in time aggregations and persisted values which will be key by different values.
closes https://github.com/sourcegraph/sourcegraph/issues/40207
Test plan
Added unit tests to cover new functionality