Agent/backend has the support to retrieve suggestions either via our custom JSON response or the OpenSearch Suggestions API standard. This means that browsers can also use Hearchco for suggestions as well as that our frontend has easier to work with types (the standard is awful IMHO).
[x] Added DDG and Google using their OpenSearch Suggestions API (since it's faster than scraping and is deterministic)
[x] If Accept header includes application/x-suggestions+json the response will be in the correct format
[x] Minimized code duplication with normal results, using interfaces and generics (it was very fun)
[x] Fixed a bug in algo for retrieving results, before when an engine sent all of it's results via the channel it was deemed as finished, but that meant that even though the results may have been partially processed (added to map) or even unprocessed it was thought of as being a "finished engine". Now each engine runs it's own retriever/collector of results and only when that channel is closed and all of the results were processed (added to map) it is deemed finished.
Closes #327
Agent/backend has the support to retrieve suggestions either via our custom JSON response or the OpenSearch Suggestions API standard. This means that browsers can also use Hearchco for suggestions as well as that our frontend has easier to work with types (the standard is awful IMHO).
Accept
header includesapplication/x-suggestions+json
the response will be in the correct format