Check out the whole SharePoint 2013 Solution Series
New Titles Added Weekly!
In SharePoint 2013 Search there are several out-of-the-box query rules to display ranked result blocks of various result types (.e.g Word, Excel, PowerPoint, etc.). These are triggered based on specific action terms that appear either in the beginning or end of a search query (or both). However, Videos is not one of them.
Therefore, it would be nice if someone performed a search query using "video" or "videos" that a promoted result block of video results would appear at the top of the results. Easier done than said!
Navigate to your Site Settings from within your Search Center site collection and click on Search Query Rules under Site Collection Administration:
Select Local SharePoint Results (System) as the Result Source:
Click on the New Query Rule link:
Add the Rule Name, select Query Contains Action Term, enter "video;videos" in the Action term is one of these phrases:
Click on Add Result Block.
Modify the Block Title. Change Search this Source to Local Video Results (System) and increase the amount of Items as desired (I used 6). Expand the Settings section.
Select the "More" link since there is already a Video Results page and enter the value shown in the image below. Select Video Item as the Display Template:
Click OK and then click Save on the New Query Rule page.
Navigate to your Search Center main page and perform a search using "videos" in the query:
The video result block appears at the top and displays the video results. The results show hover panels when moused over.
There is another way to display these results using an out-of-the-box horizontal video display template. If you go back into your Search Query Rules, edit the Video query, and then edit the Result Block, you may change the Display Template setting to just the Video entry:
Now the results are displayed horizontally along the top:
This presents well but there is no hover! You can easily modify the template (or make a new copy as the recommended approach) to display the hover. I will have those steps in another post soon!
UPDATE 5/14/2013: Here is the post that explains how to add the hover.
Is there a way to have the videos play on click or do anything other than take you to the video list item? We have a public facing website and want to have YouTube videos in our search but we don't want external users to have access to the item page for that video. I couldn't figure out how to make an item template for videos that we could take people to instead but that would be the preferred solution.
ReplyDeleteYou could add a new column to the Video list that stores a different URL to a custom page that displays the video or other info. Then include that custom URL field in the item template and use that one instead of the item URL.
DeleteMy custom display template is using several managed metadata properties.
ReplyDeleteWhen used in the query rules, the managed metadata properties are not showing up, but when I use the display template elsewhere it works fine.
Any ideas?
I have not seen this it is usually all or nothing. Make sure the display templates are checked in and published as major versions, run a full crawl, and/or bounce the query servers to clear the cache.
DeleteThanks. But in your book & blog, I believe "a step is missing".. like how you created the video library & the type of files inside it. Should we perform a full/incremental crawl after the video-content creation?
ReplyDeleteI do have blog posts around that. Here is one: http://stevemannspath.blogspot.com/2013/01/sharepoint-2013-activating-video.html
DeleteYou should perform at least an incremental crawl after populating an assets library.
This comment has been removed by the author.
DeleteGot It working. Thanks!
DeleteHi Steve,
ReplyDeleteIs there a way to configure Search in SP2013, so that we can crawl the videos which are inserted directly on a page, using the embed code method. The video resides outside sharepoint, and no asset library is used when we directly insert it on a page.
Can search still give results for such video embeds? im assuming not :(
Thanks
NG
Your assumption is correct. This is because the video would not be recognized as a video content type item as it is in the asset library when the video feature is activated.
DeleteThanks so much. ....
DeleteNG
Hi Steve,
ReplyDeleteThis is great! Thank you!
One additional question - Is there a way to make this show up in regular results 'without' the word video in the query? Such that, if I search for SharePoint, and if there are videos, they show up like this?
As long as you have a Video result type and your Search Results web part is configured to use templates based on the result types, then videos will show up within the regular results using the vertical display.
DeleteSteve,
ReplyDeleteI am displaying videos on a webpart page, I would like the pop-up to come up when the user clicks in or play the video in expanded state.
You would have to hijack the search template code to do that. Take a look at Office UI Fabric. There is a video portal example included.
DeleteHi Steve,
ReplyDeleteI'm attempting to edit the design templates to include the mediaDuration and Views Count. I added both MediaDuration and ViewsLifeTime to the ManagedPropertyMapping but this fields always comes empty on the search results. Please advise.
Thank you always for your articles. It has been a great help.
Hi Steve,
ReplyDeleteI'm attempting to edit the design templates to include the mediaDuration and Views Count. I added both MediaDuration and ViewsLifeTime to the ManagedPropertyMapping but this fields always comes empty on the search results. Please advise.
Thank you always for your articles. It has been a great help.
Which crawled properties did you map the managed properties?
Delete