Displaying Search Content in SharePointQ: What distinguishes the Content Query Web Part from the Search Results Web Part When Displaying Items from the Search? A: Both the Content Query Web Part and the Search Results Web Part let you display formatted search results, but there are some significant differences in how you can display your search results.
Let’s take an example where we search SharePoint using the keyword “SharePoint”. I’ve modified the query in the Content Search Web Part to only look for the word “SharePoint,” shown in the following screen shot:
Once I get the Query returning the correct results and click OK, I then have the following options in the Content Query Web Part editor for how to display the data:
If I select “Two Lines” from the dropdown list, the Content Search Result Web Part displays this data:
If I keep the default settings, the Content Search Web Part displays the data like this:
Unless you have pictures associated with each of your search items, you might not want to use this option. The Search Results Web Part has more options for displaying items returned from the search. Here is an example of the Query Editor in the Search Results Web Part that searches for anything containing the word “SharePoint”:
Above, the Search Results Web Part Query Builder is different than the Content Search Web Part, although both queries are searching for the term “SharePoint.” The Search Results Web Part gives you much more flexibility to display the results of the search, including using different result types for different types of items, and even an option to edit the JSON.
As the following screen shot shows, I have many choices for the Result Types to display items:
I also have options for showing Ranked Results and Sorted Results: I can even customize the Sort orders with JSON! As you can see, both the Content Search Web Part and the Search Results Web Part are useful for showing Search Results to your users. Both use content that has already been indexed, both can include data from all site collections, and both can include any data that has been indexed by the search. However, the way the two display Search Results is significantly different. Author: Shelley Vinson Helfer, one of Accelebrate’s SharePoint instructors
|