SharePoint 2013 Online Search by Content Type

Updated: Mar 18, 2019

In this article you will see how to get search results by content type in SharePoint 2013 Online.


Sign up for an Office 365 Developer Site. Be sure you have access to the Office 365 Developer Site. Here are the three ways to get one:

  • Are you an MSDN subscriber? Visual Studio Ultimate and Visual Studio Premium with MSDN subscribers receive an Office 365 Developer Subscription as a benefit. Redeem your benefit today.

  • Do you have one of the following Office 365 subscription plans?

Office 365 Midsize Business Office 365 Enterprise E1, E3, E4, or K1 Office 365 Education A2, A3, or A4 Office 365 Government G1, G3, G4, or K1


If so, you can provision a Developer Site from the Office 365 admin center. For more information, see how to create a Developer Site within your existing Office 365 subscription.

Please refer to set up a development environment for SharePoint Add-ins on Office 365 for more details.

Site Content Type

I have created a site content type with the following columns.


Document Library:

I have created a Document Library in which I have attached the “My Content Type” content type and added a few documents.


Configure Search Results web part

  • Navigate to the following search page: https://c986.sharepoint.com/search/


  • Edit the page.


  • Edit the Search Results Web Part.


  • Click on the Change query button.


  • Select Property filter as Content Type contains My Content Type and then click on the Add property filter button. Click on the Test Query button and you will see the relevant results on the right hand side.


  • Click the OK button.

  • Click the OK button in the web part properties.

  • Check in and publish the page.


  • Enter a keyword and then click on the Search button. You will be able to get the results for the “My Content Type” content type.


Summary

In this article we saw how to get search results by content type in SharePoint 2013 Online.