Skip to content

Getting a list of all Promoted Results (best bets) in a SharePoint 2013 site collection

I had a business user ask me the other day if they could see a list of all the best bets in their new 2013 SharePoint portal so that they could validate the terms and links. First off, we know in 2013 that best bets have evolved into Promoted Results. But beyond that, for a business user that does not have access to view the search configuration pages, this was unfortunately not a simple request.

I could give them access to the Query Rule configuration page, and they could scan the query rule table, looking for those items identified as Promoted Results amongst the other types of query rules, however they still can’t see the links to the best bets.

QueryRules

Doing a Bing search will return some scripts that may help you. But many of them only return promoted results from the Search SSA (not from a site collection). I thought I would share what I used in  case it helps someone else. Note, I named all my Query Rules that have promoted results with the prefix “PR:” and that’s how I filter, but of course you can change it to add your own criteria, or none at all.

This script will both list the Promoted Results in the PowerShell Window as well as output the values to a file. Hope it can help you!

Output

$SearchServiceName = “Search Service Application”

$sspApp = Get-SPEnterpriseSearchServiceApplication $SearchServiceName

$siteUrl = “http://myportal/search

$site = get-spsite $siteUrl -WarningAction SilentlyContinue

$web = $site.rootweb

$fedManager = New-Object Microsoft.Office.Server.Search.Administration.Query.FederationManager($sspApp)

$SearchOwner = New-Object Microsoft.Office.Server.Search.Administration.SearchObjectOwner([Microsoft.Office.Server.Search.Administration.SearchObjectLevel]::SPWeb, $web)

$SearchObjectFilter =  New-Object Microsoft.Office.Server.Search.Administration.SearchObjectFilter($SearchOwner)

$queryRuleManager = New-Object Microsoft.Office.Server.Search.Query.Rules.QueryRuleManager($sspApp)

$queryRules = $queryRuleManager.GetQueryRules($searchObjectFilter)

$bestbets = $queryRuleManager.GetBestBets($SearchObjectFilter)

$promotedResults = $queryrules | Where-Object{$_.DisplayName -match “PR”}

$promotedResults | ForEach {

Write-Host “Query Rule Title:  ” -ForegroundColor “Yellow” –NoNewLine

Write-Host   $_.DisplayName -ForegroundColor “White”

Write-Host “Terms: ” -ForegroundColor “Yellow”  –NoNewLine

Write-Host $_.QueryConditions.Terms -ForegroundColor “White”

Write-Host “Best Bet Title(s):” -ForegroundColor “Yellow”   –NoNewLine

Write-Host -ForegroundColor “White”   $_.AssignBestBetsAction.BestBetIds.GetBestBetsFromIds().Title

Write-Host “Best Bet URL(s):”  -ForegroundColor “Yellow” –NoNewLine

Write-Host -ForegroundColor “White”   $_.AssignBestBetsAction.BestBetIds.GetBestBetsFromIds().URL

Write-Output “Query Rule Title: ”   $_.DisplayName

Write-Output “Terms: ”  $_.QueryConditions.Terms

Write-Output “Best Bet Info: ” $_.AssignBestBetsAction.BestBetIds.GetBestBetsFromIds()} >>  c:\output.txt

.

Advertisements

Help Microsoft make the Ignite Event all that it promises to be!

In case you missed it, Microsoft announced the upcoming mega-event called Ignite. It’s sort of an amalgamation of the Management Summit, the Exchange, SharePoint, Lync, Project, and TechEd conferences all in one place. I for one am excited for this and now we can influence the direction of the event.

Microsoft has posted a call for topics. They want to know what we want to hear and see, how we want to spend our time there, etc. Please take a moment to fill this out – it will hopefully benefit us by giving Microsoft the feedback about what we want and need the event to be. Follow this link to participate: http://ignite2015.eventpoint.com/survey/callfortopics

More on this topic soon!

Q&A with the SharePoint MVP Experts Chat On Oct 29th @1pm EST or 10am PDT

 Hello everyone

The SharePoint MVP Expert Chats are picking up again!  Have questions about SharePoint 2010 or 2013?  Or SharePoint Online? Office 365?  Please join us October 29th at 1pm EST or 10am PDT where you can have your questions answered live!  We will be using the Reddit Ask Me Anything format.  This is new to us but many of Microsoft teams are using this medium now.  Please create a Reddit account beforehand so you can be ready to ask questions.  More information on the chat and room location will be available on Oct 29th in the SharePoint forum.  Hope you can join us!

 https://www.reddit.com/r/sharepoint

 Hope you can join us!

MVP Experts Participating:

1.      Andrew Connell

2.      Cathy Dew

3.      Doug Hemminger

4.      Doug Ware

5.      Eric Shupps

6.      Gavin Barron

7.      John Ross

8.      Kris Wagner

9.      Randy Drisgill

10.   Sahil Malik

11.   Sean McNeill

12.   Shane Young

13.   Spencer Harbar

14.   Todd Bleeker

15.   Trevor Seward

16.   Wictor Wilen

SharePoint Fest Denver Wrap-Up

I had the honor of presenting a couple of sessions at SharePoint Fest – Denver 2014 this week. It was a great event with some top-notch presenters, including Microsoft thought leaders, MCMs, MVPs, community leaders and local talent.

Thanks to the organizers  – hope I can attend next time!

As promised in my two sessions, I’m posting links to the assets (code samples, display templates, etc.) that I covered in my sessions.  Both slide decks should appear here shortly, if they’re not already there: http://www.sharepointfest.com/Denver/slidedecks/506-sharepoint-fest-2014-search-track

Session SRC 201 – 6 Proven Steps to Get the Best Out of Search in SharePoint 2013
Download assets here: https://paulolenick.codeplex.com/downloads/get/810094

Session: SRC 105 – Learn about the top 5 advanced search features you never knew you needed
Download assets here: https://paulolenick.codeplex.com/downloads/get/913230

As a reminder to the attendees of this session, the Content Enrichment Web Service sample I used is based on Cory Roth’s great example which you can find here: http://code.msdn.microsoft.com/SharePoint-2013-Search-5e1e92a7   (Thanks Cory!!!)

Enjoy!

Presenting at Australian SharePoint Conference (Share The Point)

I’m very excited to report that I’ll be presenting at the 5th Annual Australian SharePoint Conference 15-16 July 2014 at the Hilton, Sydney

Not only will this be my first time presenting at this conference, but it will be my first time setting foot on the continent! I’m really looking forward to seeing old friends like John White, Marc Anderson and others as well as making new friends and learning  a lot about SharePoint!

I’ll be presenting a session titled “Four Steps to Migrate Content from any On-Premises Source to SharePoint Online” in which I lay out the process and considerations for a migration to SharePoint online – especially when moving there from a non-SharePoint system. It should be a dynamic and fun presentation, and one that I hope is relevant to many attendees.

If you’re in the area (or even if you’re not) I hope I’ll see you there – it’s shaping up to be a great conference. Check out the site here: http://www.sharethepoint.com/engage/AU2014/

 

Two Stories of how Enterprise Social Drives Real Value – This week on ShopTalk

Many people don’t really understand what Enterprise Social is, and what benefit it can bring to an organization. In this presentation, you will hear two real-world scenarios where it provides true value and how it is accomplished.

** Register Today **

About Our Presenter

As a Microsoft SharePoint MVP with over 20 years of IT industry experience, Ruven has spent the past nine years delivering award-winning SharePoint solutions for a wide range of clients. Working as a Business Analyst and Information Architect, Ruven is able to apply his eclectic education and varied experience in Psychology, Computer Science, Economics, Software Development and Training to get to the heart of complex problems. Ruven is a great communicator who is able to discuss technology concepts in language that is relevant to his audience, whether they are from IT or business.

He has become a leader in the use of visual tools to help his clients and team members achieve shared understanding of problems and goals and shared commitment towards implementing a successful solution.

Ruven recently authored “Practical SharePoint 2010 Information Architecture” (Apress) Ruven lives in Toronto, Canada. On Tuesday nights in the summer, you’ll find him racing his 24’ sailboat ‘In the Groove’.

Power BI – What Is It, How Does it Work, and Why Does It Matter – This week on ShopTalk

Power BI is the next generation self-service BI tool from Microsoft. But What is it exactly? Join us as we walk through the various products that make up Power BI, and discuss how they work.

** Register Today **

About Our Presenter

John P White is the Chief Technical Officer at UnlimitedViz Inc. He holds a Master’s degree in Engineering from the University of Guelph and is a Microsoft SharePoint MVP. He has spent 22 years in the Information Technology space, and posesses a skill set that spans both architecture and development.

He has been instrumental in delivering projects and applications that have been recognized with both local and global awards from Microsoft and IBM. As a seasoned IT professional, John has accumulated a plethora of legacy technologies like Novell, Lotus Notes and Java. This experience has proven invaluable when architecting systems alongside legacy applications.

Over the past decade, he has become increasingly focused on the Microsoft SharePoint and Business Intelligence platforms and has become an expert with the latest that these platforms have to offer.

He blogs as actively as possible at http://whitepages.unlimitedviz.com. John lives in Guelph, Ontario, and is the father of 3 boys, is an avid scuba diver, and a budding photographer, both under and above the water. Samples of his work can be found at http://www.flickr.com/wpages.