How to create a custom search results page?

You can create a custom search results page, in SharePoint’s classic search results page, by following these instructions:

  1. Create a custom search results page:
    1. Login to Microsoft 365 and open the “Admin” app:
      The app launcher in Office 365
    2. Open the “SharePoint” admin center:
      The link to SharePoint's admin center
    3. Open “search” settings.
      If you are using the Classic admin center you find it here:
      The link to search settings in SharePoint's classic admin center
      If you are using the Modern admin center, you will find it here:
      The link to search settings in SharePoint's modern admin center
    4. Open “Search Center Settings”:
      Open SharePoint's "Search Center Settings"
    5. Copy the “Search Center URL” and open it in a new tab.
      Copy SharePoint's "Search Center URL"
    6. Enter a search query and press enter or click the magnifying glass.
      Enter a search query
      This will take you to the SharePoint’s default search results page.
      You should not edit this page, as it might be used somewhere else within the organisation. You should instead create a new search page customized with your needs.
    7. Click on the “Settings” icon and select “Site contents”:
      Link to SharePoint's "Site contents"
    8. Open the “Pages” library:
      Open the "Pages" library
    9. Create a new custom search page, by clicking on “New” in the toolbar, and selecting the “Page” option:
      Create a new custom search page
    10. Give the page a meaningful “Title”, a “URL Name” and select “(Welcome Page) search results”, as “Page Layout”:
      Give the page a meaningful Title, URL and Page Layout
    11. Click on the “Create” button.
  2. Customize the “Refinement” web part:
    1. Open the newly created custom search page.
    2. Edit the page by clicking on the “Settings” icon and then selecting the “Edit page” option:
      Edit the page
    3. Edit the “Refinement” web part, on the left side of the page, by hovering over the arrow next to the web part’s name and then selecting the “Edit Web Part” option:
      Edit the "Refinement" web part
    4. In the web part’s property form, on the right-hand side of the page, click on the “Choose Refiners” button:
      Click on the "Choose Refiners" button
    5. Remove the default refiners, by selecting them and clicking on the “Remove” button and add the refiners that you earlier mapped, when configuring your managed properties, by selecting them and clicking on the “Add” button:
      Add the refiners you want to use
      For a reference to the refiners’ names, use the spreadsheet that you earlier created and sort them in the order they should be presented, as defined in the spreadsheet.
      If you add more than 10 refiners, you will get a warning that it might decrease search performance. It is however quite safe to add more than 10, but not more than 20, which is the maximum number of refiners.
      For each of the refiners:
      Give the refiners a meaningful name and choose an appropriate display template
      1. Give them a “Display name” (the name that the refiner will have on the search results page, preferably the same name as the column’s display name).
      2. Select a “Display template”.
        • The default and recommended options is to choose “Refinement item”, where users can refine on just one value:
          A display template of type "Refinement item"
        • If the users want to be able to refine on multiple values in a refiner then choose “Multi-value Refinement Item”:
          A display template of type "Multi-value Refinement Item"
        • If the metadata column is a date, then the “Slider with bar graph” is a good option:
          A display template of type "Slider with bar graph"
    6. Click on the “OK” button.
    7. Save the modified “Refinement” web part by clicking on the “OK” button in the web part properties panel.
  3. Customize the “Search Navigation” web part:
    1. Edit the “Search Navigation” web part, by hovering over the arrow next to the web part’s name and then selecting the “Edit Web Part” option:
      Edit the "Search Navigation" web part
    2. Click on the “Search Settings page” link:
      Click on the "Search Settings page" link
      A new tab opens up with the title “Site Settings : Search Settings”.
    3. On the “Configure Search Navigation” section, click on “Add Link”:
      Add a link on the "Configure Search Navigation" section
    4. Enter the “Title”, e.g. “Documents” and the “URL” (the address to the newly created search results page) and click on the “OK” button  to return to the page:
      Give the link a title and an URL
    5. Select the new search navigation and click on the “Move up” icon to move it up where it should be, e.g. under the Everything option:
      Move up the new link
    6. Click on the “OK” button, on the bottom of the page.
    7. Close the tab and return to the custom search results page where you save the modified “Search Navigation” web part by clicking on the “OK” button in the web part properties panel.
  4. Customize the search results web part. The search results web part is used to restrict/filter the results on the custom search results page, e.g., the link to “People”, needs to show up only results related to users. For the current scenario we need to restrict the Documents link. Do the following:
    1. Edit the “Search Results” web part, by hovering over the arrow next to the web part’s name and then selecting the “Edit Web Part” option:
      Edit the "Search Results" web part
    2. Edit the web part and click on Change Query:
      Change the query on the "Search Results" web part
    3. See to it that your query is in “Advanced mode” (you should see “Switch to Quick Mode” on the page:
      See to it that your query is in "Advanced mode"
    4. Replace the standard “Query text” in the multi line box:
      The default search query
      with this string: 
      (IsDocument:"True" OR contentclass:"STS_ListItem") -FileType:aspx -ParentLink:/SiteAssets/ (-ContentTypeId:0x0120* OR ProgID:OneNote.Notebook) {SearchBoxQuery}
      The customized search query
    5. By default, SharePoint removes all duplicate documents from the search page. To avoid this behavior, switch to the “SETTINGS”, and select the entry “Don’t remove duplicates”:
      Don't remove duplicates
    6. Click on the “OK” button on the form to save the changes.
    7. Save the modified “Search Results” web part by clicking on the “OK” button in the web part properties panel.
  5. Save, check in and publish the page by first clicking on the “Check it in” link on the top of your page:
    Check in the page
    and once it is checked in, the click on the “Publish it” link:
    Publish the page
  6. Your custom search results page is now created and is ready to use. It now has:
    1. The defined refiners on the left of the page
    2. The “Documents” scope
    3. And the results should only show documents
  7. Copy the path to the created custom search result page and paste it into the “SharePoint’s search result page” field in MetaShare’s general settings page and click on the “Save” button:
    "SharePoint’s search result page" field in MetaShare’s general settings