Monday, August 10, 2020

Search Options for Microsoft Stream

The Issue

If you've tried out Microsoft Stream within your Office 365 tenancy, then chances are you've begun to realize that its searching capabilities leave much to be desired (they stink). To be fair, the app offers searching across all videos, but only finds text matches and orders results by most views. This can be somewhat mitigated by organizing the videos into channels and then searching within, but again, results are surfaced by most views, rather than relevance to the search keywords. Do I expect YouTube class results? Certainly not, but it's next to impossible to find meaningful results without refiners who at least some basic algorithmic factors to match results. In my tests, results with vague transcript matches and more views were weighted higher than full text match results in the title, description, and transcript, but had no views, due to the poor searching mechanism. Every "discovery" feature of MS stream is focused on overall viewership, versus quality of metadata or interest. One more shortcoming is that the search results cannot be crawled or queried from SharePoint Online Search. More can be read in the official documentation:

SEARCHING: https://docs.microsoft.com/en-us/stream/portal-search-browse-filter

EXPLORING: https://docs.microsoft.com/en-us/stream/portal-explore-content 


One Workaround

A very simple approach, is to use an html input element to collect search term and apply simple javascript to concatenate a string from a search value, pointing to https://web.microsoftstream.com/browse and using the query string parameter "q" to set the search value. I tried using the built in SharePoint search web parts, but it always appends a extra "k" query string parameter, which breaks the string handed off to Stream. This works as a basic example, but again, is limited by Stream's lack of intelligence search options and compiling results based on popularity, rather then relation to the search terms. On the plus side, this does allow a formulated query to passed from SharePoint Online to Stream. See the following code example for this idea (which monitors keystrokes for a "return" or "enter" key press to execute the inline script):

<input type="text" onkeyup="javascript: if(event.keyCode === 13)window.open('https://web.microsoftstream.com/browse?q='+this.value,'openSearch');" />


Another Take

I looked for a simple way to use the same kind of search by query string parameter in the channel search, but it looks that Microsoft is using an asynchronous API call for channel search, different from result filtering by query string as with the general video search. In looking at it briefly, it seemed to be a JSON result that could be parsed and styled with a little work, but I didn't dig much further as the results will again be fueled by popularity.  


A Mix of Services

In the case of what I was designing, I found I could achieve the best of all my requirements for using Stream to buffer video, then using a SharePoint Online Asset Library, using the embedded video option, to create index-able records with metadata that would be accessible to Search. In this way, I can build pages and content around those results, using Stream only as host service, rather than a content platform. This proved to be the most effective of everything tried. 

Have you tried to tackle this challenge as well? What kinds of solutions did you try out?