Expand Minimize

SMA256402: WebParts that use search

The new Search Results WebPart, and Content Search WebPart will be able to replace almost any search based result webpart currently in use.

CheckId SMA256402
TypeName WebPartsThatImplementSearch
Severity CriticalWarning
Type Assembly

Full Trust Approach App Approach
Search Post 2013

The use of the Search API in code has for some time helped developers use the power of the Search Features in their webparts to display the required data. This helps increase the performance of older SharePoint platforms.

Search 2013 and Onwards

Search now drives most of what you see and work with in SharePoint 2013. New WebParts have been included Out of the Box for displaying search results. When combined with JSLink they become an powerful resource for displaying information across the SharePoint Farm.

Impact of Full Trust Approach Benefit of App Approach
Replaced by Out of the Box components

Previously, to access the Search API through code was necessary. This has now been addressed and replaced with Out of the Box WebParts.

Out of the Box

Search Results and Content Query WebParts provide 99% of use cases of wanting to display data. If you require a more complex component, then the search api is fully functional in the App Model.

Efforts and Benefits

Migration Impact Critical
Re-Design Effort IMedium
Re-Development Effort Medium ~ Critical High
Long Term Benefit High

Effort Drivers

  • Out Of the Box
  • More powerful than older search topologies in SharePoint

To suppress this violation in managed code add the following attribute to the method which contains the instruction (available since SPCAF version v5.2). Learn more about SuppressMessage here.

// Important: Ensure to have #define CODE_ANALYSIS at the beginning of your .cs file
[SuppressMessage("SPCAF.Rules.MigrationAssessment.CollaborationCustomizationsGroup", "SMA256402:WebPartsThatImplementSearch", Justification = "Provide reason for suppression here")]
Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.