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.

7 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hi Mikael,

    Recently I found another difference between the two web parts.

    If you try to list sites within the two web parts you will get a different result.

    more details here:
    https://veenstra.me.uk/2016/03/30/office-365-sharepoint-search-results-web-part-vs-search-content-web-part/

    ReplyDelete
    Replies
    1. I'll bet if you turn off the default duplicate trimming on the search result webpart you get the same results :)

      Delete
    2. Hi Mikael,
      Hmm, nice catch! Weird though the site urls are not duplicates.

      Delete
    3. It's crappy near duplicate detection in SP using shingling on too few fields which cause this. See my old post http://www.techmikael.com/2013/12/duplicate-trimming-in-sharepoint-2013.html

      Delete
  3. For me the biggest difference is Search WP is able to query cross-site collection. CSWP is only for list / libraries on the same SC.

    ReplyDelete
    Replies
    1. That is fortunately just plain wrong :) You need to hit the config wizard again and examine the options available.

      Delete