Working With SharePoint Search Center In SharePoint Online

Search is one of the most widely used features of SharePoint Server, which helps users to fetch relevant information by typing the related information in the search box. SharePoint Search architecture is made of the below components.

  • Crawl and content processing
  • Index
  • Query processing
  • Search administration
  • Analytics

A successfully configured Search Service will have all the above components working in unison. Each of the components will have a database created in the SQL Server. On a high level, the crawl component is responsible for crawling the SharePoint content and collects the crawl properties which will in turn be sent to the content processing component. The content processing component receives the crawled properties, processes it and sends it to the Index Component. 

The index component receives the processed items from the content processing component and writes it to the search index. At the same time, it is responsible for returning the results for a search query from the search index.

When the user inputs a search query and presses enter, the query is processed by the Query Component and is submitted to the Index Component for data retrieval from search index.

Search administration component performs the overall administration of Search like instantiating search service instance and related components.


Image Source: Microsoft MSDN

SharePoint Online Search

SharePoint Online has inbuilt Search functionality just like we have the Search Service Application in SharePoint On Premise. Whenever we search for the search keyword in the search box, the results is displayed in the osssearchresults.aspx page. We cannot customize osssearchresults.aspx page since it is a page stored in _Layouts in the Microsoft Cloud and in online environment, it is shared by all tenants.

Searching for a sample keyword “SP 2016” in the search box will send the query to the Online Search Service.


The results will be displayed using the Out of the box Ghosted page - osssearchresults.aspx


It will also have the refiner in the left side using which we can further filter the displayed results.


Create Search Centre

In order to overcome the limited use of osssearchresults.aspx page, we can create a custom Search Center in SharePoint online. This brings in much control over how results are displayed and helps to customize the results page. From SharePoint Admin Center, select New.


Specify the Title and Website address. Mention the Template selection as ‘Enterprise Search Center’.


Add the time zone, site collection administrator, and click on OK.


This will create the SharePoint Online Search Center. Heading over to the Pages library we can see Out of the Box pages used by the search center to display the search result. Results.aspx is the page that will be used to show the default search results.


By default Results.aspx is not customized.


But we can open it up in edit mode and use Content Editor Web part to add customizations. A simple text has been added to CEWP as shown below.


Set Search Centre in tenant site collections

Once we have created the Search Center, we will have to set it manually in other tenant site collections. In order to do that, go to Site Settings -> Search Settings.


Mention the Search Center URL and Results page URL to the pages in the Search Center.


Now, let’s search for a keyword in the Site Collection where the content is located. This will send the query to the Online Search Service and the results will be displayed in the customized results.aspx page.


Summary

Thus, we saw how to create a custom search center and use it with other site collections in the tenant to display search results.