Creating a search scope

SharePoint 2007 and 2010 included the option to add scopes to a drop-down list next to search boxes in the sites. This would allow site administrators to create narrowed down search results for specific uses. For instance, a scope could be created to only return items from a specific library.

With SharePoint 2013, Microsoft has removed the concept of search scopes. Instead, we will need to create a new search results page with a limited search query. In this recipe, we will add a new search results page to our search center to return only images.

How to do it…

Follow these steps to create a new search results page for images:

  1. Navigate to our search center in your preferred web browser.
  2. Click on Site contents from the Settings menu.
  3. Select the Pages library.
  4. From the FILES tab in the ribbon, click on Welcome Page from the New Document drop-down menu as shown in the following screenshot:
    How to do it…
  5. Provide a title and URL for the page, for instance, Images in the Title and URL fields.
  6. Select (Welcome Page) Search results for the Page Layout feature in the following screenshot:
    How to do it…
  7. Click on Create.
  8. Click on the Images page in the Pages library to navigate to it.
  9. Click on Edit page from the Settings menu.
  10. Click on Edit Web Part from the drop-down menu on the Search Results web part as shown in the following screenshot:
    How to do it…
  11. Click on Change query in the web part edit pane as shown in the following screenshot:
    How to do it…
  12. Set the Property Filter to ContentType Contains Image as shown in the following screenshot:
    How to do it…
  13. Click on the Add property filter.
  14. Click on OK.
  15. In the web part edit pane, click on OK.
  16. Click on Publish from the PUBLISH tab in the ribbon. Click on Continue to publish the page.
  17. Click on Site settings from the Settings menu.
  18. Click on Search Settings from the Search section as shown in the following screenshot:
    How to do it…
  19. In the Configure Search Navigation section, add a link to the newly created page. For instance, Images with /sites/search/pages/Images.aspx as the URL as shown in the following screenshot:
    How to do it…
  20. Click on OK.
  21. Navigate to the search center home page.
  22. Enter a keyword to search for and press the Enter key.
  23. Click on the newly added Images navigation option to observe the filtered results.
    How to do it…

How it works…

The search results web parts on search results pages use search-specific queries to determine which results to show for a particular search. For instance, the Conversations search results page uses a search query that returns only the Newsfeed items. In this recipe, we created a new search results page that queried only for the Image items by their content type.

See also

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.242.235