Tuesday, December 23, 2014

Content Search Web Part vs. Search Results Web Part

Want the book? Go get it!

This is the bonus episode in my series “SharePoint Search Queries Explained - The Series”. See the intro post for links to all episodes.

If you have Enterprise license for SharePoint 2013 on-premises or you are using SharePoint Online Plan 2 (Office 365 E3/E4) then you have both web parts available. If you don’t have the E powers, you only have the Search Result Web Part, and this is what I will try to highlight. In what scenarios can you use the Search Result Web Part when you don’t have the license for CSWP?

The table below list functionality and differences between the web parts. I am omitting some of the search result query specific functionality like language dropdown, sorting and preferences, as they are more relevant to an interactive search page.

CSWP
Search Result WP
Property Mappings via web part settings
X
Start displaying results from specified result number
via web part settings or #s=
URL parameter
via the s= URL parameter
Don’t show anything if there are no results
X
via custom control template
Caching support
X
Support content routing, choosing result table
X
Support paging
Via “List with Paging”
control template
Via web part settings
Choose display template based on Result Type
X
Manually choose display template for all items
X
X
Refine/filter results
with query builder or URL parameter
with query builder or URL parameter
Support async/sync first load
X
X
Support include duplicates
X
X
Support query rules
X
X
Use catalog URL instead of real URL
X
X
Max # of results to show (without hack)
50
50
Show promoted results
via result table
via control / display template

In general, any URL parameter you can use with the Search Result web part you can also use with the CSWP.

As you see from the above table, the two web parts overlap on almost all parts of functionality. The CSWP has some more web property settings making it easier to use without editing display templates directly, it support caching which is useful for publishing scenarios where a lot of people have the same read access to the items displayed, and lastly it allows content orchestration which I wrote about in S15E10: Search Orchestration – Page composition in rule major, allowing better workflows and page loading optimizations when constructing search driven pages.

Also see How to enable Content Search Web Part Display Templates for Search Result Web Part on how to re-use CSWP display templates with the Search Result web part.