Showing posts with label Text Box. Show all posts
Showing posts with label Text Box. Show all posts

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? 

Thursday, March 13, 2014

SharePoint 2010 - The data source control failed to execute the insert command

I wanted to take a moment to highlight an extremely helpful post, answered by Siraj regarding the intimidating error "The data source failed to execute the insert command" error in SharePoint 2010. The issue surfaces when customizing the ...\newform.aspx of any list and attempting to submit the completed form. Per his writing, this is the diabolical aftershock of implementing Service Pack 2 on the perspective SharePoint 2010 farm. This was absolutely the crux of the trouble in my case, although I had to take one or two more steps after updating the SharePoint:SPDataSource as he notes (I won't spoil it for you by copying his answer - you can visit his notes for the specific change!).

To fully conquer this trouble, I enacted the following:

  1. Updated the SharePoint:SPDataSource as noted in Siraj's answer
  2. Included ALL required fields in the custom newform.aspx
This second item may not cause as much consternation, but for some forms, I didn't want to populate the "title" field with user input, but rather later with system calculated or concatenated data. For initial releases of SharePoint 2010 up through Service Pack 1, this worked fine to omit "title" from my custom forms. Going forward, this is sadly no longer the case. If you find yourself in similar state of woe, the following will work!

  1. Set a default text value for the affected field in the affected List Settings (This MUST be done via the web GUI, as no one seemingly thought it important enough to include in the Designer column edit tools)
  2. Add the field to the custom newform.aspx
  3. Embed the field within a <div> tag using the following CSS styling to hide it (The exact ID is not important and could be virtually anything, but if left to the system generated Id, it will be something like "ff[Number]{$Pos}"):
    • <div style="display:none">
    • <SharePoint:FormField runat="server" id="ff6{$Pos}" controlmode="New" fieldname="Title" __designer:bind="{ddwrt:DataBind('i',concat('ff6',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Title')}" />
    • </div>
  4. I tested adding the field as an "ASP:TextBox" to enact code-enforced default text rather than setting the default in the List Settings web GUI, but didn't seem to satisfy the mean warnings
That should do it!