Skip Ribbon Commands
Skip to main content

Quick Launch

Laura Rogers @WonderLaura > Posts > SharePoint 2013 Web Part: Content Search
July 17
SharePoint 2013 Web Part: Content Search

CropperCapture[77]**NEW VIDEO to go with this post

The new content search web part in the SharePoint 2013 preview (enterprise) is just awesome, awesome, awesome. 

Remember quite a while back when I wrote a post about how to utilize the search results web part to show the logged in user a list of sites that they have access to?  Well now in this new SharePoint, this web part is used all over the place, and you can also insert it anywhere you want.  For example, when you are on your My Site and you see a list of all of the tasks assigned to you, THAT is this web part rolling up that content from all over the farm.  Also, on the Community Portal (site collection template), you see a list of all community sites rolled up in one list.  THAT is also this web part.  There are many other examples, but let me go ahead and show you the coolness:

 

 

When I click the Change Query button, it brings up this interface with TONS of options, and as you change options your live results show in the search results preview on the right:

 

 

Basics

You can select from Documents, content types, tags, videos and more, and then pick the scope, such as a certain site or site collection, or unrestricted (whole farm).

CropperCapture[80]

Refiners

There a many refiners (filters) you can choose from.  In this case, SharePoint recognizes that I created a column called “Department” in a document library, so it shows as a refiner.  There are dates, file types, creator, editor, content types, size, and more.

CropperCapture[81]

Settings

On the settings tab, you can even change the performance of your web part on the page!  Wow, this is much better than that old content query web part which could be a real hog.

CropperCapture[82]

Test

The test tab shows you the actual query text that is used behind the scenes to create that query.

CropperCapture[83]

After I click OK at the bottom of this query page, there are still more settings available in the web part properties.

Number of Items to show

You can set up the default number of items to show in the web part.  The default is 3.

Display TemplatesCropperCapture[84]

The control drop-down box lets you choose from list, list with paging, and slideshow.

The Item drop-down box has selections such as “picture on left”, 2 lines, large picture. 

 

Property Mappings

CropperCapture[85]Depending on what you select in the Item drop-down box, you have different choices in the Property mappings. 

Since I chose two lines, I get to customize what those 2 lines are if I want to.  Right now, line 2 is empty, but I can pick another property to display on that second line, like the last modified by person, or a description or something.

 

Settings

CropperCapture[87]The Result Table drop-down lets you pick from Relevant Results, Personal Favorite Results, Refinement Results, and Special Term results.

 

 

In summary:

Remember that for search results to be accurate, you have to actually have your search crawls / indexing set up and on a schedule.  If your search only indexes the content once a day, then the results in this web part could be a day old.  If you set up your index say, every 20 minutes, you’re going to have much more accurate and current results displayed.

CropperCapture[78]

 

Comments

Thorsten Hans

Hi Laura,

nice post on one of the great new SP 2013 features. The Content Search WebPart is just awesome.
 on 7/18/2012 8:19 AM

Nishan

Hi Laura,
This web part looks cool. I am wondering since the content of this search web part is only fresh as the last crawl, wouldn't it be nice to also show the last refresh (recrawl) time stamp somewhere on the web part? This way everyone looking at the web part knows whether their content is 20 mins or 2 hours old etc. Not sure if this capability is available OTB...
 on 7/18/2012 10:38 AM

Nik Charlebois

I got a question from a colleague of mine about the XSL editor option that seems to be gone from the web part toolbar. How would one go and modify the XSL template for the search results in SharePoint 2013? Any ideas? Thanks
 on 9/27/2012 8:55 AM

Beatrix Krammel

Hi Laura,
thanks for this post! Do you have an idea which settings I need to change to have Content search web part or the content query web part avaiable? I enjoyed your Video a lot, but without having these options, I can't make use of it. Any ideas?
 on 11/29/2012 4:25 AM

Laura

Nishan,
There's some new continuous crawl type of feature now in 2013, so you shouldn't have to worry about when the last crawl was.

Nik,
Here's a post from the SharePoint team blog that may answer your question: http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?pID=1050

Beatrix,
Content Query web part is gone, and content search web part doesn' seem to exist in office 365.
lauraNo presence information on 12/18/2012 9:28 PM

Tapan Bhatt

This is really a nice post, I'd like it very much, my question is can we apply formating on serch result e.g.: if I qant to add columns with some fancy buttons and manage that item using that button? Is this thing possible with it?
 on 3/1/2013 5:03 AM

Intelcs.com

Certainly Content Search web part is a nice improvement over content Query web part because of the limitation of Site Collection. The functionality of using different styling is also been upgraded with more style using XSL. Another most valuable feature is dynamic query builder along with the query variables like Today, Current User Name etc.
 on 4/24/2013 11:41 PM

Catalina

Hi Laura-

I am trying to use the Content Search webpart to create a suggested people listing for my job site (SP2013).

Basically I have a custom list of Jobs and a contact list of Candidates. I want to match the skills required by the job with the skills that a candidate has. (I should mention that my Skill column is a Managed Metadata column)

The thing is, that both jobs and candidates will have multiple skills requirements and so far I can only match 1 candidate skill to 1 job skill. I have searched everywhere because I am having trouble with the Statement and I am not very familiar with the query language. Maybe I am completely out of my range at this point but I really wanted to give it a try before going into SPD.

If I were to tell the query story I would say "From all Candidates, show me the list item in Candidates where Skill (Column in Candidate List) contains Skill (In Job Skill Column)"- Example: If a job requires HTML, CSS and C# and my Candidate has HTML & C# knowledge listed in the Skills column (HTML; C#) I want him/her to show up in my results as a suggested candidate.

The job list and candidate list are separate. They share a site column called Skills. I have all this in a separate webpart page called candidate search, I have tried filters, CSWP, CQWP, etc... with not much luck.

Any ideas of how I can accomplish this with the Content Search web part would be absolutely appreciated! Your posts are always so helpful!
 on 4/29/2013 5:38 PM

Laura

Hi Catalina,
That sounds like a really cool idea, but I can't think of how it could be accomplished.  I did find this Keyword Query Language (KQL) syntax reference for you... http://msdn.microsoft.com/en-us/library/ee558911.aspx
Laura RogersNo presence information on 6/13/2013 11:35 AM

Angela

Hi Laura
I've working on setting up some sites in SharePoint Online and wanting to use the Content Search webpart.  I can get it to provide results in the Search Result Preview pane of the webpart  but when I save the query and the webpart no results are acutally displayed on the page (despite that I can see the same documents as are displayed in the preview results).

Any ideas?  This is driving me nuts!

thanks
 on 1/22/2014 7:25 PM

Laura

Angela,
Hi, I've seen that happen a couple of times, but it seems pretty random.  Usually I've been able to delete the web part and start over and the problem goes away, or I just tweak it like crazy and it eventually works, but there is no rhyme or reason.  :-S
Laura RogersNo presence information on 2/3/2014 2:46 PM

Anup

I am using Content Search Web Part to surface the popular item in site and in Display I am using List Control and Picture on left, 3 lines on right.
I get the correct result set BUT the issue is I am not getting thumbnail for items.

In regular search center I am able to get the thumbnail and hover over is working fine but struggling with this web part.

Any suggestions?
 on 2/12/2014 2:45 AM

Donna

Hi Laura,
I have a content search web part which displays recent forums created. I chose List as Control Display Template and Two lines for Item Display Template. (I just need a list, with the title and author information). I'm new to Sharepoint and still working my way to explore its features.

Bottom line is, I would like to get rid of the icon found at the left side per result. On your provided screencap, the Word document icon.

Hoping or your quick response. Thanks!

Twitter handle is @donna_mae
 on 2/21/2014 2:41 AM

Laura

Anup,
You can try using the Search Results web part instead of the Content Search web part, and you may get the look and feel that you need.

Donna,
Hi, unfortunately they don't give many options for adjusting the way these look.  The next step is to try (what I suggested to Anup) or you'd have to get a dev involved and create a custom display template.
Laura RogersNo presence information on 3/26/2014 10:01 AM
 

 Contacting You Back

 
​When you ask a question here, and would like to know when I answer you, please provide your twitter handle, so I can ping you when I respond.  It takes me a few weeks sometimes.  Also, if you put a link in the Comment URL box, your comment will automatically get deleted.  This is because of all of the spam comments I get.

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Your Name *


Body *


CommentUrl


Today's Date *

Select a date from the calendar.

Attachments

Laura Rogers @WonderLaura
RSS FeedFacebookYouTube
 

 Our Books for End Users

 
40+ Premium Web Parts for SharePointHarePoint SharePoint workflowsHarePoint SharePoint workflowsSharePoint CRMSharePoint CRMSharePoint CRMData Connector by BoostSolutionsData Connector by BoostSolutionsData Connector by BoostSolutionsData Connector by BoostSolutions