Content Search Web Part in SharePoint 2013 Online

Introduction

Content By Search Web Part (CSWP) is a new web part introduced in SharePoint 2013. CSWP is similar to Content Query Web Part (CQWP) that is used to display the contents from the search index. Content Search Web Part displays search results that can be easily formatted.

How Content Search Web Part works

Content Search WebPart

The following are the essential things for CSWP:

  • Query Builder
  • Display Templates.

Advantages of CSWP

The following are the advantages of using the CSWP:

  • Displaying data from multiple lists/libraries at the same time.
  • Displaying content across site collections.
  • Easy to change the look of search results.
  • Displays the content from outside that was crawled and available in the search index.
  • No more XSLT. HTML and JavaScript files are used to render the information.

Differences between CSWP and CQWP

Content Search Web Part (CSWP) Content Query Web Part (CQWP)
Returns any content from the search index. Returns instant content.
Displays the major versions of the content. Displays the major and minor versions of the content.
Returns results only from the sites that are marked to be indexed. Returns results even from the sites that are not marked to be indexed.
HTML and JavaScript are used to render the information. XSLT is used to render the information.

Create CSWP in SharePoint 2013 Online

In this section you will see how to build a simple query to display all the images from the current site and display as the slideshow in CSWP.

  1. Navigate to a SharePoint page.
  2. Click on the Page tab and then click on the Edit button in the ribbon interface.
  3. Click on the Insert tab and then click on the Web Part button in the ribbon interface.

    Insert in WebPart
     
  4. Click on the Content Rollup category, select Content Search and then click on the Add button.

    ContentRollup in SharePoint
     
  5. Edit the web part and click on the Change Query button in the Properties section.
  6. Select Pictures (System) from the “Select a Query” dropdown list.

    Building Query in SharePoint
     
  7. Click on the Ok button.
  8. Select Slideshow from the Control dropdown list in the Display Templates section.

    Content Search in SharePoint
     
  9. Click on the Ok button.
  10. Click on the Save button in the ribbon interface.
  11. All the pictures from the current site are displayed as a slideshow.

    Displaying SlideShow in WebPart

Summary

Thus in this article you saw the basics of the Content Search Web Part in SharePoint 2013.

Up Next
    Ebook Download
    View all
    Learn
    View all