Wednesday, 26 October 2011

Display a Web Part as a Visual Best Bet in FAST Search Server 2010 for SharePoint

FAST Search Server 2010 for SharePoint has a number of nice visual enhancements you don’t get with regular SharePoint Server Search, such as document previews and visual best bets. This blog post provides a walkthrough of making use of Visual Best Bets to display a SharePoint Web Part.

How do Visual Best Bets work?

MOSS 2007 and SharePoint Server 2010 provide Best Bet functionality that lets you specify some HTML to display as a Best Bet. A FS4SP Visual Best Bet on the other hand lets you specify a URL, the web page for the URL is then displayed in a web part using an iFrame.

If I setup a Visual Best Bet for the keyword “SharePoint” and specify a document library as a Visual Best Bet I get this:

The document library displays in an iFrame above the search results. If we edit the page you can identify the web part that displays the Visual Best Bet.

There’s one useful property you can edit for the ‘Search Visual Best Bet’ web part. The very first web part property displayed for the web part is called iFrame Height.

The default for this is set to 150 pixels. You can edit this property to allow you to display your Visual Best Bet with a higher height, as an example if I increase this to 300, I get the following.

So that’s how Visual Best Bets work… so I’ve been thinking of the best way to make use of Visual Best Bets to display some truly awesome looking dynamic content.

Well SharePoint can display dynamic visually rich content can’t it?

Here’s a page displaying a video using the Media Web Part.

Here’s a page displaying an Indicator Details web part for a KPI in a status list.

Here’s a page with a chart web part.

Wouldn’t it be nice if we could display Web Parts as Visual Best Bets?

If we try that, if I create a keyword for “FAST Search” and use the video page as a Visual Best Bet I get this:

 The page chrome, ribbon, banner, navigation etc. is getting in the way – wouldn’t it be nice if we could just display the Media Web Part as a best bet?

This is possible in SharePoint, you can selectively hide what is rendered on a page using CSS. A quick way to remove a large amount of page chrome is to use the IsDlg=1 query string parameter. So where my Video Page URL is:

If I edit the Visual Best Bet, and change the URL to this:  

I get the following in search results:

Much better! IsDlg=1 is used by SharePoint when displaying popup dialogs, the query string parameter hides page chrome. We still have an issue regarding not all content being displayed. There are two options with this:

1) Reduce the web part height in the video page.

2) Increase the height of the iFrame for the Visual Best Bets Web Part in the search results page.

Both will work, If I go with option 2 – I get this:

That looks sweet, it is displaying an inactive scroll bar… but let’s just ignore that :)

If we do the same with the KPI Web Part page we get:

Here’s what the chart web part looks like:

So you can quite easily setup Visual Best Bets with FAST Search Server 2010 for SharePoint to show a visually stunning Web Part if you:

1. Create a page and add your desired web part to it.

2. Ensure the web part height is less than the Visual Best Bets web part height, by either reducing the height of the web part you want to display, of increasing the iFrame Height property on the Visual Best Bet web part on the search results page.

3. Create a Visual Best Bet to your web part page and add the ?IsDlg=1 query string parameter to the end of the URL.

With all of the various types of dynamic web parts you get with SharePoint, you now have no excuse for not making good use of Visual Best Bets in FAST Search Server 2010 for SharePoint.

Sunday, 23 October 2011

Slide Deck from SharePoint Saturday Melbourne - Developing a Custom FAST Search Server 2010 for SharePoint Solution

I'm back home in Perth from SharePoint Saturday Melbourne. I had an awesome time in Melbourne, spent most of the time with my sister, brother in law and four neices.

My presentation on Developing a Custom FAST Search Server 2010 for SharePoint Solution went really well, I did an overview of my FAST Spatial Search Toolkit solution.

Slide deck below:

Sunday, 16 October 2011

FAST Spatial Search Toolkit Installation

This post contains installation steps required to deploy the FAST Spatial Search Toolkit.

Execute the createspatialmanagedproperties.ps1 PowerShell script via the Microsoft FAST Search Server 2010 for SharePoint shell as a FAST Search administrator on a FAST Search Server.

This script will create six managed properties – north, south, east, west, latitude & longitude.

After these managed properties are created, you need to map data that either has longitude & latitude pairs stored as numeric or decimal values, or map data that has north, south, east & west bounds as numeric or decimal values. Spatial data must be based on WGS84 (

Ensure you run a full crawl after mapping your crawled properties to these managed properties.

Add the Sezai.FastSpatialSearchCenter.wsp farm solution to your farm ( and deploy the solution to the web application where you want to create the FAST Spatial Search Center site.

Navigate to the site collection where you want to create the FAST Spatial Search Center.

Two Site Collection Features need to be activated before creating the site.

Activate FAST Spatial Search Center Layouts and FAST Spatial Search Web Parts.

Now create a new site based on the FAST Spatial Search Center template.

Before you can use the new FAST Spatial Search Center site, you need to enter your Bing Maps API Key in three different pages default.aspx, results.aspx and bigmap.aspx.

Edit default.aspx and edit the properties of the Bing Maps Silverlight Web Part. Expand the Other Settings attribute section and edit Custom Initialization Parameters. Replace YOURAPIKEY with your Bing Maps API Key.
Check in the page.

Ensure you then Publish the page.

Repeat this process on results.aspx and bigmap.aspx.

Download - FAST Spatial Search Toolkit

The FAST Spatial Search Toolkit v1.0 contains a custom site definition based on the FAST Search Center site definition and incorporates a Bing Maps Silverlight Control to provide spatial search.

For installation details check out: FAST Spatial Search Toolkit Installation

FAST Spatial Search Toolkit v1.0 - Search for Spatial Data with FAST Search Server 2010 for SharePoint

I've been working on a custom FAST Search Server 2010 for SharePoint Solution which is an extension to the FAST Search Center site template that allows you to search for data that is spatially referenced.

Many organisations deal with data that is spatially referenced, this solution provides the ability to search for data with FS4SP using a map control to zoom in on a specific piece area of interest so you can focus on finding data specific to that area.

For v1.0 of the FAST Spatial Search Toolkit I've developed a custom site definition based on the out-of-the-box FAST Search Center site definition. The FAST Spatial Search Center incorporates a custom Silverlight 4 application that uses the Bing Maps Silverlight Map Control to allow searches to be refined spatially and for visualisation of spatial search results.

The out-of-the-box default.aspx and results.aspx pages have been customised to incorporate a small map control for spatial filtering and visualisation. A large full screen map page is also included that queries FAST Search via the search web services for returning and visualising thousands of search results across an area.

Check out the following video for a demo of the solution:

The FAST Spatial Search Center supports searching for points and bounding boxes. Point data is represented by Longitude and Latitude coordinates and bounding box data has a North, South, East and West bound which represents an area.

If you would like to deploy and test the solution out yourself, you will need your own Bing Maps API key and will also need to create six FAST Search managed properties to allow the solution to query search results spatially.

It's FREE (requires a Bing Maps API Key) to download you can download the solution from the Download - FAST Spatial Search Toolkit page.

For detailed steps on setting up the solution, check out the FAST Spatial Search Toolkit Installation post.

Monday, 10 October 2011

I'm Speaking at SharePoint Saturday Melbourne - FAST Spatial Search Center Overview

I'm flying from Perth to Melbourne for SharePoint Saturday Melbourne on the 22nd October 2011. My buddy and coworker at CSG, Bhavik Merchant will also be there to present a talk on PowerPivot for SharePoint 2010.

My session will provide a technical overview of my FAST Spatial Toolkit solution.

Wednesday, 6 April 2011

SharePoint Saturday Perth 2011 - April 9th

There's 3 days left until the SharePoint Saturday Perth event on April 9th! More info and registration here: I'm presenting a Technical Overview of FAST Search Server 2010 I will also be helping out with running the event on the day. There are some AWESOME raffle prize giveaways up for grabs at the event!

Sunday, 13 March 2011

Creating FAST Search Managed Properties and Mappings to Crawled Properties with Powershell

My presentation at the Australia SharePoint Conference went really well last week. As part of the demos I completed five search crawls. After the initial crawls I mapped some new Managed Properties to Crawled properties and then concluded with configuring some refiners in a FAST Search Centre.

To help speed up this process I performed the property creation and mappings using Powershell. A few of the attendees has asked for these scripts, so here they are:

Example One - Create a new 'category' managed property, and map it to two crawled properties

$categorymanagedproperty = New-FASTSearchMetadataManagedProperty -Name category -type 1 -description "SPCAU Demo Property"
Set-FASTSearchMetadataManagedProperty -Name category -Queryable $true -StemmingEnabled $true -RefinementEnabled $true
$categorycrawledproperty1 = Get-FASTSearchMetadataCrawledProperty -name "productcategorydescription"
$categorycrawledproperty2 = Get-FASTSearchMetadataCrawledProperty -name "searchviewread listelement.productcategorydescription"
New-FASTSearchMetadataCrawledPropertyMapping -Managedproperty $categorymanagedproperty -crawledproperty $categorycrawledproperty1
New-FASTSearchMetadataCrawledPropertyMapping -Managedproperty $categorymanagedproperty -crawledproperty $categorycrawledproperty2

The New-FASTSearchMetadataManagedProperty command creates a new managed property.
Set-FASTSearchMetadataManagedProperty allows us to update settings on the managed property, such as enabling querying, stemming and refinement.
Running Get-FASTSearchMetadataCrawledProperty will output all of the crawled properties in the index, so this command is typically executed with parameters that filter down the property to retrieve one crawled property.
Finally the New-FASTSearchMetadataCrawledPropertyMapping command takes a managed property and crawled property as parameters and maps the two together.

It's as easy as that!

Another pattern I had in my scripts is to map a crawled property to an existing managed property.

Example Two : Map a crawled property to an existing managed property

$titlemanagedproperty = Get-FASTSearchMetadataManagedProperty -Name title
$titlecrawledproperty = Get-FASTSearchMetadataCrawledProperty | where-object {($_.Name -eq "productname") -and ($_.CategoryName -eq "JDBC")}
New-FASTSearchMetadataCrawledPropertyMapping -Managedproperty $titlemanagedproperty -crawledproperty $titlecrawledproperty

The above example maps the productname crawled property to the title managed property. The Get-FASTSearchMetadataManagedProperty command is used to get an existing managed property instead of creating a new one. Note also that the Get-FASTSearchMetadataCrawledProperty in the above example differs from the previous, where-object is used to apply filters on not only the crawled property Name but also the CategoryName, I found I had to do this as the specific crawled property name was not unique for some reason, this is quite a common situation, by also specifying the crawled property category we can ensure we're picking up the correct property.

Example Three - Undo Properties and Mappings

This final example includes commands to delete managed properties or property mappings.

Remove-FASTSearchMetadataManagedProperty -Name category -Force
$titlemanagedproperty = Get-FASTSearchMetadataManagedProperty -Name title
$titlecrawledproperty = Get-FASTSearchMetadataCrawledProperty | where-object {($_.Name -eq "productname") -and ($_.CategoryName -eq "JDBC")}
Remove-FASTSearchMetadataCrawledPropertyMapping -Managedproperty $titlemanagedproperty -crawledproperty $titlecrawledproperty -Force

The first command Remove-FASTSearchMetadataManagedProperty will delete the managed property and all it's property mappings. The next three commands involve deleting only a mapping of properties - you wouldn't want to delete the title managed property!!! So you need to get the specific managed property and crawled property and then run the Remove-FASTSearchMetadataCrawledPropertyMapping command to remove the mapping. Note the -Force parameter executes the command without prompting the user for confirmation.

I recommend creating, configuring and mapping FAST Search properties using Powershell as its quicker than doing the same using the FAST Query SSA. More importantly it's repeatable! So this is particularly useful when you need to repeat the same work between environments from Dev --> Test --> Production. Leaving this to be done manually is too time consuming and prone to human error. A word of warning though - don't develop your Powershell scripts in production! You could inadvertently alter some out of the box managed properties or other settings as you're trying to work out your scripts.

Monday, 14 February 2011

Searching Database Content with FAST Search for SharePoint 2010 - Part 3 - Using the BCS

To help with the BCS example, I first create an SQL View using the following SQL.













FROM Contoso_Retail_DW.dbo.DimProduct p

LEFT OUTER JOIN Contoso_Retail_DW.dbo.DimProductSubcategory psc

on p.ProductSubcategoryKey = psc.ProductSubcategoryKey

LEFT OUTER JOIN Contoso_Retail_DW.dbo.DimProductCategory pc

on psc.ProductCategoryKey = pc.ProductCategoryKey

SQL View FAST Search

Next we fire up SharePoint Designer to create the External Content Type.

SharePoint Designer BCS External Content Type

Click the External Content Type ribbon action.

SharePoint Designer BCS External Content Type

Click the Click here to discover external data sources and define operations.

SQL View FAST Search

Select SQL Server as the data source.

SQL View FAST Search

Enter the connection info

SQL View FAST Search

SQL View FAST Search

Right click on SearchView and select New Read Item Operation

SQL View FAST Search

Enter details about the operation

SQL View FAST Search


SQL View FAST Search

Then Finish

SQL View FAST Search

Now create a New Read List Operation

SQL View FAST Search

Enter operation details

SQL View FAST Search

Next, note the warning regarding specifying a limit filter.

SQL View FAST Search


SQL View FAST Search

Now click Summary View in the Ribbon, select ProductName from the Fields List and click the Set As Title ribbon action.

SQL View FAST Search

SQL View FAST Search

Now save your external content type

SQL View FAST Search

Now if we browse to our site collection, there's a Contoso Product list and we can see the BCS in action!

SQL View FAST Search

The BCS option has a nice feature that the JDBC connector didn't have - Profile Pages.

You can create a site to host profile pages, and then in your Business Connectivity Services Service Application, you can create Profile pages for your external content type

SQL View FAST Search

SQL View FAST Search

If I browse to the profile page, I get this error.

SQL View FAST Search

That's a good error :) because I haven't specified a product id as a query string parameter the error tells me it can't find the item, that suggests that its at least querying the DB.

Now navigate to your FAST Content Search Service Application

SQL View FAST Search

Create a new Content Source and specify Line of business data as the content source type, and select Contoso_Retial_DW

SQL View FAST Search

Now start a crawl! When a crawl is running you can check if it's working in the crawl log.

SQL View FAST Search

SQL View FAST Search

If crawls fail to work you can get a useful message through the crawl log

I also suggest you fire up ULSViewer to see what the cause is. ULSViewer is THE BEST TOOL for troubleshooting BCS and FAST Crawling using BCS.

Now that it looks like our crawl has successfully finished, lets try a test search

SQL View FAST Search

I get two results, the first is from the BCS and the second item is from the JDBC connector. I wonder why the teaser description is different between the two? The BCS also has a different icon due to search resolving the JDBC item target as a folder.

Thanks to profile pages, I can actually click the BCS result which takes me to the profile page for the product.

SQL View FAST Search

This is one area which would require a bit of extra work and development if you go with the JDBC connector approach.

Finally, we want to map some search properties. The managed properties from the previous demo are still setup, so I'll map the new BCS crawl properties to these same managed properties.

Now when you are in the FAST Query Search Service Application, don't click on the Metadata properties link in the left menu, 'these aren't the search properties you're looking for' /waveshand.

SQL View FAST Search

If you mess with property mappings in there you won't see your BCS properties, instead click on the FAST Search Administration link.

Then click on the Managed Properties link.

SQL View FAST Search

Click on Crawled property categories

SQL View FAST Search

You should notice the Business Data category with a larger number of properties, click the Business Data link.

SQL View FAST Search

There's a list of our crawl properties!

You can map crawled properties through to managed properties through here too.

SQL View FAST Search

After mapping all the crawled properties to managed properties, perform a full crawl.

Now retest the same search

SQL View FAST Search

Note the refiner counts have all incremented compared to the previous test search, so the property mappings and refiners are now setup, it's as easy as that!

Thanks for reading! I've got one more post to go for this series, I'll perform a closer comparison of the pros and cons of the the JDBC Connector and BCS Connector and why you might use either depending on your requirements and priorities.