4

I'd like to display a usercontrol on the homepage of my SharePoint site. The control will display a list of the most popular searches performed in a given period, say the previous month.

Does anyone know how to interact with the search application service to determine this information?

1

You can see if the Web Analytics Web Part is sufficient to you:

http://blogs.msdn.com/b/ecm/archive/2010/03/21/introducing-web-analytics-in-sharepoint-2010.aspx

If not, then you can write your own custom web part that use web analytics to present it to the user.

This blog post might be of interest:

http://matthewyarlett.blogspot.co.uk/2012/10/getting-little-more-from-sharepoints.html

0

If this is SharePoint 2013, "Popular Searches" web part available in SharePoint 2010 has been removed from SharePoint 2013.

So we will have to follow the steps as mentioned

If you’ve upgraded from SharePoint 2010 to 2013 and previously made use of the Popular Searches web part, you may or may not have noticed that it no longer exists. In its place, there are now Popular Items and Recommended Items web parts (see: https://technet.microsoft.com/en-us/library/dn794211.aspx). While these web parts are all well and good, if you are looking to recreate the Popular Searches web part in SharePoint 2013 and don’t know where to start then look no further. In this blog I’ll quickly walk through how you can do this with fairly minimal customization.

For the uninitiated, the Popular Searches web part simply displayed a number of popular search terms and provided the ability for a user to click on the term and immediately be taken to the search results page for that query. This could be placed anywhere but typically was found on the primary search entry page somewhere near the search box.

In order to recreate this we have 2 challenges:

  • GET THE DATA
  • DISPLAY THE DATA

STEP 1: GET THE DATA

While Web Analytics no longer exists in SharePoint 2013, the SharePoint UI does track almost all search interactions (queries, clicks, etc). We won’t get into much detail about it here (see this for more detail: http://blogs.msdn.com/b/nathan_brackett/archive/2014/07/03/search-reporting-and-sharepoint-2013-introduction.aspx), but we will be leveraging some custom PowerShell scripts found here: http://www.microsoft.com/en-us/download/details.aspx?id=43394

STEP 2: DISPLAY THE DATA

The data we are looking to display is relatively straightforward. We have a Query Term, optionally a Count, and we want to use our Url field as the link for each item. In the interest of keeping things very simple, we can use an out of the box Content by Query web part. That requires that we push our popular search data into a SharePoint list. In our lab, we created a list with a few custom fields directly on the Search Center site. Also, don’t forget to disable crawling of this list as we don’t really need this data being surfaced in search results.

Populating this data can be automated using whatever mechanism you prefer. PowerShell can be used either on server side or using CSOM. We just need to get the data into a list in order to display it to end users.

https://blogs.msdn.microsoft.com/nathan_brackett/2015/11/11/recreating-the-popular-searches-web-part-in-sharepoint-2013/

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.