How to Optimize SharePoint 2010 Search With Managed Property

In this article I am showing you how to create a managed property in SharePoint 2010. Normally we should use SharePoint to search and the results includes folders, documents and web pages. Sometimes SharePoint may take a long time to search a page looking for documents and web pages that meet the search criteria. In this article I am showing you a way to make it easier for users to identify content other than folders in their search results.

Create a Managed Property

The managed property can be used to help users filter search results to make it easier for them to identify relevant content.

Create a New Managed Property

  1. Navigate to Central Administration.
  2. Under Application Management, click the Manage Service Applications link.

  3. Click the Search Service Application link.
  4. In the left navigation panel, click the Metadata Properties link.
  5. At the top of the page, click the New Managed Property link.

  6. In the Name and Type section, typeDocumentType in the Property name text box.
  7. In the Mappings to Crawled Properties section, click the Add Mapping button.
  8. In the Crawled Property Selection dialog, type ows_contenttype in the Crawled Property Name text box, and then click the Find button.

  9. In the Select Crawled Property list, select the ows_contenttype (Text) crawled property, and then click the OK button.
  10. Check the Include values from a single crawled property based on the order specified option.
  11. In the Optimize Managed Property Storage section, check the Reduce storage requirements for text properties by using a hash for comparison option.
  12. Click the OK button to finish.

Start a Full Crawl on the Content Source

  1. Click the Content Sources link in the left navigation panel.
  2. Hover your mouse above the Local SharePoint sites and click the drop-down arrow.

  3. In the context menu, click Start Full Crawl.
  4. After the full crawl is completed, the new managed property can be used in the Refinement Panel Web Part in the next exercise.
  5. Please do an IIS reset, this is to refresh the managed properties cache.

Use a Managed Property in the Refinement Panel Web Part

The managed property can be added to the Refinement Web Part to help users filter search results. We start by adding a new refinement category to the web part. This is accomplished by creating and modifying XML and adding it to the Refinement Web Part's configuration. When this is done, you will do a search and filter the results using the new managed property.

The main task we are going to perform are listed below

  1. Navigate to the search results page and open the Refinement Panel Web Part for editing.
  2. Create and modify XML to add a new filter to the Refinement Panel Web Part.
  3. Execute a search and use the new category filter.

Navigate to the Search Results Page and Open the Refinement Web Part for Editing

  1. Open your browser and navigate to your web application.
  2. On the Site Actions menu, click New Site.
  3. Select an Enterprise Search Center Site and enter Search for the URL and Title.
  4. Click Create.
  5. You will be navigated to the results page URL: http://hostaddress/SearchPages/results.aspx
  6. On the Site Actions menu, click Edit Page.
  7. In the Refinement Panel Web Part, hover your mouse over the upper-right corner until a blue drop-down arrow displays. Click the drop-down arrow to display the Web Part menu, and then Edit Web Part. This opens the Web Part tool pane.

  8. In the Refinement section, clear the Use Default Configuration check box.

Create and modify XML to add a new filter to the Refinement Panel Web Part.

In the Refinement section, click on the Filter Category Definition textbox, and then click the ellipsis button for the Filter Category Definition field. This opens the Text Entry window for the Refinement Panel Web Part's Filter CategoriesDefinition property.

  1. Next, insert the XML snippet at the place noted in the previous illustration. This represents the new filter category using the managed property you created earlier.

    Category XML

    <Category Title="Document Types" Description="Different types of documents" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="5" NumberOfFiltersToDisplay="4" MaxNumberOfFilters="20" SortBy="Frequency" SortByForMoreFilters="Name" SortDirection="Descending" SortDirectionForMoreFilters="Ascending" ShowMoreLink="True" MappedProperty="DocumentType" MoreLinkText="show more" LessLinkText="show fewer" />
  2. Click the OK button of the Text Entry window.
  3. Click the OK button of the Refinement Panel Web Part's tool pane.
  4. In the Page section of the Ribbon, click the Save & Close button.

Execute a Search and Use the New Category Filter

  1. In your browser, navigate to your home page of your site.
  2. In the search box, on the home page, type Document.
  3. Click the Magnifying Glass icon to execute a search.
  4. In the search results page, the Refinement Panel displays on the left. Click a different Document Types category, specifically Wiki Page.

Observe that when you click on a Document Type category, the search results are filtered to show just the results of that category. This helps the user narrow the results, making easier to browse.