Monday, March 18, 2013

SharePoint 2013 Search: Managed Property Added to Display Template Doesn't Appear

The Search Display Templates in SharePoint 2013 provide a nice and easy way to modify how search results appear to the end user. This may involve adding additional managed properties to the mark-up such that the display template shows additional fields of search data.

However, just adding the managed property to the display template does not automatically bring it into the search results. After making changes to your display template, you may need to update the corresponding result type. This is an easy process.

Go to your site collection settings and under Site Collection Administration click on Search Result Types:

 
On the Manage Result Types page, you'll see a Property Sync message:


This is easily overlooked as it appears similiar to the health analyzer message. Simply click the Update link in the message box. The result types are updated with your display template changes:



Your new managed properties should now flow through into the search results!
 

SharePoint Designer 2013: Business Data Connectivity Metadata Store is Currently Unavailable

When using SharePoint Designer 2013 to create External Content Types, you may find yourself getting a message similiar to the following:



The Business Data Connectivity Metadata Store is currently unavailable.


First make sure that you have the Business Data Connectivity Service Application created in Central Admin:

 
 

Next, check the Services on Server and make sure the Business Data Connectivity Service is started:

Chances are the service has not been started. Once the service is started, you should be able to create external content types in SharePoint Designer 2013.

Wednesday, March 13, 2013

SharePoint 2013 Search: Moving the Query Component to a Web Front End

Introduction
When you first create the Search Service Application, the search topology by default has all components running on one server. I performed the SSA creation on our "Index" server and therefore all components are there accordingly. However, I want to scale out the SSA a bit and have at least the Query Components running on the web front ends. (This does require more resources as the query processing is much more robust than in previous versions). Therefore I used PowerShell commands as outlined in the Microsoft TechNet documentation. This post documents the script I created to perform the task. The full script is located at the end of the post.

Initial state of the Search Topology:




You may use the SharePoint 2013 Management Console, or use the PowerShell console issuing the SharePoint add-in:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue


Step #1 - Clone the Active Search Topology

# Clone the active search topology
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active


Step #2 - Add the New Search Component on the WFE
# Add New Search Component
$wfe = Get-SPEnterpriseSearchServiceInstance -Identity "<<web front end server name here>>"
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $clone -SearchServiceInstance $wfe


Step #3 - Start the Search Instance on the WFE# Start Instance On Different Server
Start-SPEnterpriseSearchServiceInstance -Identity $wfe


Step #4 - Activate the Cloned Search Topology
# Activate Search Topology
Set-SPEnterpriseSearchTopology -Identity $clone

 

At this point the Query Component should be running on the original location as well as the WFE:




So we need to remove it from the original server.

Step #5 - Clone the Search Topology Again
# Clone Again
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active


At this point, you either need the ComponentID or the Name of the component you wish to remove. By default the first query component is named QueryProcessingComponent1 so the full script will work. However, if you issue the cmdlet statement  Get-SPEnterpriseSearchComponent -SearchTopology $clone you can identify both:


Step #6 - Get the ComponentID to Move
# Get the Search Component ID To Move
$queryComponentID = (Get-SPEnterpriseSearchComponent -SearchTopology $clone -Identity QueryProcessingComponent1).componentID


Step #7 - Remove the Search Component from the Original Server
# Remove Search Component
Remove-SPEnterpriseSearchComponent -Identity $queryComponentID.GUID -SearchTopology $clone -confirm:$false


Removing the search component from the original server may show a red x icon on the topology in Central Admin:



Step #8 - Activate the Search Topology Again
# Activate Search Topology Again
Set-SPEnterpriseSearchTopology -Identity $clone



Once the topology is reactivated, all is good:

 
The Query Processing component has now been moved to the web front end!!

It is recommended to also have the Index Partition (ala the Index Components) reside on the same server as the Query Components. Here is a post about also moving the Index Partition to the web front end.


Full Script


Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

# Clone the active search topology
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active


# Add New Search Component
$wfe = Get-SPEnterpriseSearchServiceInstance -Identity "<<web front end server name here>>"
New-SPEnterpriseSearchQueryProcessingComponent -SearchTopology $clone -SearchServiceInstance $wfe


# Start Instance On Different Server
Start-SPEnterpriseSearchServiceInstance -Identity $wfe


# Activate  Search Topology
Set-SPEnterpriseSearchTopology -Identity $clone


# Clone Again
$ssa = Get-SPEnterpriseSearchServiceApplication
$active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
$clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone –SearchTopology $active


# Get the Search Component ID To Move
$queryComponentID = (Get-SPEnterpriseSearchComponent -SearchTopology $clone -Identity QueryProcessingComponent1).componentID


# Remove Search Component
Remove-SPEnterpriseSearchComponent -Identity $queryComponentID.GUID  -SearchTopology $clone -confirm:$false


# Activate  Search Topology Again
Set-SPEnterpriseSearchTopology -Identity $clone


SharePoint 2013: Allow Embedding of External Content

In my previous post regarding embedding videos from YouTube, a reader mentioned that SharePoint would only allow YouTube videos to be embedded but not other sites. To understand the behavior of sites not authorized, I removed YouTube and attempted to embed a new video:

The embed code is invalid because the source of the embed content is not allowed.


I received an error message "The embed code is invalid because the source of the embed content is not allowed." as shown above. This is an easy fix. There are default domains configured within SharePoint site collections that permit contributors to insert iframes:
  • youtube.com
  • youtube-nocookie.com
  • player.vimeo.com
  • bing.com
  • office.microsoft.com
  • skydrive.live.com

You may add additional domains to this configured list. To access this permission configuration, go to the Site Settings of the Site Collection you wish to modify. Locate and click on the HTML Field Security link under Site Collection Administration:

 
On the HTML Field Security page , enter the domain (e.g. videosite.com) in the provided text box, and click Add.
 

 

Once the new domain appears in the list, click OK.

You may also simply select "Permit contributors to insert iframes from any external domain into pages on this site" to allow anything and everything. That may be a little gutsy but would save people trouble.

 

Friday, March 8, 2013

SharePoint 2013/2016: Adding YouTube Videos to Your Video Library

Video streaming within your SharePoint environment was made possible in SharePoint 2013. The video files can be uploaded to SharePoint itself, linked into SharePoint as explained here, or referenced by embed code as explained in this post. To add support for Videos in your site collection, see this post.


To add a video from YouTube to your SharePoint video library, first navigate to the video on You Tube. Under the video stream, click on Share and then Embed. Copy the embed code:



In SharePoint, navigate to your Video library (Assets Library) and click on New Document -> Video from the File top ribbon bar:




On the Videos page, select the "Provide code to embed a video from the web option", enter a name for the Video, and paste the embed code into the box provided:



Click OK. You are taken to the Video Properties page. Enter or modify any property settings and then click Save (either at bottom of the page or from the Edit top ribbon).

That's it! The YouTube video appears in your Video library as if it was actually in there:

As one of my readers pointed out (see comments), SharePoint now also supports a simple way of embedding YouTube videos into news feed posts by just pasting a YouTube URL; not the embed code for a video, but its page URL. Thanks David Bukhan!






Matched Content