Using the SharePoint Search “Best Bet” feature to redirect to a landing page

[Cross-posted from Tech And Me]

As described on TechNet:

Best Bets are recommended results. Best Bets can link to recommended Web sites, data stores, and documents. When a user includes a keyword or one of its synonyms in a query, the search results page features links to its associated Best Bets in a prominent position.

This can look something like this for the search term “search” on my sample site:

image

In order to turn this into a landing page redirect we will change the uri scheme and edit the Best Bet web part xslt. By using this method you might see a quick flicker of the page before the redirect, but compared to the work involved it might be a small price to pay.

First we need to add a new Best Bet term. We do this by navigating to the site collection settings page where your search center site is hosted and choose “FAST Search keywords”. This should also work if you are not using FAST, but you have to choose “Search keywords” instead.

image

Next click “Add Keywords”

image

Enter your search term, in this example “search” and click OK.

image

Hover your mouse over your search term, click the down arrow and select the “Add Best Bet” link. (Adding a Best Bet for regular search looks a bit different, but the procedure is more or less the same)

image

Enter a title and note that I instead of “http”, enters “redirect” in front of the url

image

Navigate to the search result page and enter edit mode. Next edit the Best Bet web part.

image

Under “Data View Properties” open the XSL Editor. If you copy out the xsl you will around line 67 add the following code:

image

The added xsl will check for url’s starting with “redirect”, and use javascript to redirect to the actual url.

After saving the changes to the web part and the page, try to search for your defined best bet term, and you should be redirected.

Article written by

Computer literate and search enthusiast with an interest for sharepoint, coding, and life in general :)


Leave a response





XHTML: These tags are allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Page not found - Sweet Captcha
Error 404

It look like the page you're looking for doesn't exist, sorry

Search stories by typing keyword and hit enter to begin searching.


OSLO

Comperio AS
Øvre Slottsgate 27
NO-0157 Oslo,
Norway
+47 22 33 71 00
View map

STOCKHOLM

Search Provider Sverige AB
Gamla Brogatan 34
SE-11 120 Stockholm
Sweden
+46 8-21 49 00
View map