In my current SharePoint 2010 site collection I have 122 Best Bet keywords setup. I'm trying to find out how to bring them into SharePoint 2013 as Query Rules.

I read that these Best Bets are in WSS_Content database, but having imported and updated that content database to 2013, and then checking the Query Rules (in CA and the Site Collection Administration section), I cannot find any query rules based on my keyword best bets.

Failing automatic conversion, I'm trying to find good sources for information to create my own conversion script, either as C# or Powershell. Any source links out there? Having trouble finding them via google/bing.



A few resources to get you started:

In the OM, the Best Bets are exposed as a collection off individual Keywords in the Microsoft.SharePoint.Search.Extended.Administration.Keywords namespace:

Keyword.BestBets Property

There are some PowerShell examples of working with Best Bets here:

Add, remove and display Best Bets for a keyword by using Windows PowerShell (FAST Search Server 2010 for SharePoint)

As far as adding the Query Rules in 2013 goes, this is a nice blog post that has some example PowerShell and walks you through the process:

SharePoint 2013 - Manage Search Query Rule using Powershell

You'll have to store the values in an intermediary format to move it between servers (CSV? XML?), but I'm sure you can figure that out.


Ah, part of the disconnect here is that SharePoint 2013 did away with Best Bets.

Check out this blog by Pedro DeRose:

What happened to Best Bets? Introducing Query Rules

Edit 2

Also, this page explains the new changes to working with Query Rules, but from the perspective of reading them, not creating new ones:

What’s New In SharePoint 2013 Search (Developers Perspective) Part Three

You're right though about a lack of documentation on this. Digging through the OM though, there are a couple interesting classes / properties / methods that I would toy with if I were you.

QueryRule members

QueryRuleCollection.CreateQueryRule method

QueryRule.CreateQueryAction method

QueryActionType enumeration

I did find one questionably legitimate result on Google from a Russian news aggregator site(!?), but only on a cached version. It's a question where the poster is using the QueryActionType enumeration. The link to the original article has been deleted from MSDN... so... I have a screenshot from the cache:

QueryActionType use

  • Thanks for the comments and idea. I'd read (thoroughly) the "Manage Search Query Rule using Powershell" article, and it makes some sense, but this is a specific type of Query Rule and I'm having trouble finding the right syntax for Actions being to promote a link (the article does an ordering of results). The other link to "Add, remove and display Best Bets" is what I need for 2013 as well... – QMKevin Jun 27 '13 at 14:22
  • Well, that was fun. Hope that helps get you where you need to be. Learning experience for me too. – RJ Cuthbertson Jun 27 '13 at 15:03
  • Incredibly helpful! Thank you. I'm getting to grips with most of it, but there is line that references queryRule (singular). It appears to be an IEnumerable (as CreateKeywrodCondition requires one) but I've no idea what to add here. Still, I'm looking around and am a lot further than I was :) – QMKevin Jun 27 '13 at 16:51
  • Glad this helped. – RJ Cuthbertson Jun 28 '13 at 18:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.