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
- Navigate to Central Administration.
- Under Application Management, click the Manage Service Applications link.
- Click the Search Service Application link.
- In the left navigation panel, click the Metadata Properties link.
- At the top of the page, click the New Managed Property link.
- In the Name and Type section, typeDocumentType in the Property name text box.
- In the Mappings to Crawled Properties section, click the Add Mapping button.
- In the Crawled Property Selection dialog, type ows_contenttype in the Crawled Property Name text box, and then click the Find button.
- In the Select Crawled Property list, select the ows_contenttype (Text) crawled property, and then click the OK button.
- Check the Include values from a single crawled property based on the order specified option.
- In the Optimize Managed Property Storage section, check the Reduce storage requirements for text properties by using a hash for comparison option.
- Click the OK button to finish.
- Click the Content Sources link in the left navigation panel.
- Hover your mouse above the Local SharePoint sites and click the drop-down arrow.
- In the context menu, click Start Full Crawl.
- After the full crawl is completed, the new managed property can be used in the Refinement Panel Web Part in the next exercise.
- Please do an IIS reset, this is to refresh the managed properties cache.
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
- Navigate to the search results page and open the Refinement Panel Web Part for editing.
- Create and modify XML to add a new filter to the Refinement Panel Web Part.
- Execute a search and use the new category filter.
- Open your browser and navigate to your web application.
- On the Site Actions menu, click New Site.
- Select an Enterprise Search Center Site and enter Search for the URL and Title.
- Click Create.
- You will be navigated to the results page URL: http://hostaddress/SearchPages/results.aspx
- On the Site Actions menu, click Edit Page.
- 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.
- In the Refinement section, clear the Use Default Configuration check box.
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.
- 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" />
- Click the OK button of the Text Entry window.
- Click the OK button of the Refinement Panel Web Part's tool pane.
- In the Page section of the Ribbon, click the Save & Close button.
- In your browser, navigate to your home page of your site.
- In the search box, on the home page, type Document.
- Click the Magnifying Glass icon to execute a search.
- In the search results page, the Refinement Panel displays on the left. Click a different Document Types category, specifically Wiki Page.
Reference:
www.c-sharpcorner.com/UploadFile/roji.joy/how-to-optimize-sharepoint-2010-search-with-managed-property/
No comments:
Post a Comment