Friday, November 08, 2013

Use of Managed metadata in Search refinement SharePoint 2010

There are two cases to use managed metadata :

1. Show all managed metadata site columns in search refinement panel:

we should use following xml :
  
< FilterCategories >  

< Category    Title="Managed Metadata Columns"    Description="Managed metadata of the documents"    Type="Microsoft.Office.Server.Search.WebControls.TaxonomyFilterGenerator"    MetadataThreshold="3"    NumberOfFiltersToDisplay="3"    MaxNumberOfFilters="20"    ShowMoreLink="True"    MappedProperty="ows_MetadataFacetInfo"    MoreLinkText="show more"    LessLinkText="show fewer" />  


</ FilterCategories >

This is part of refinement panel xml  by default.

This will show all managed metadata and ordering will be created automatically.

2. . Show a specific managed metadata site columns in search refinement panel : For example we want to add a managed metadata column with name "Test ManagedMetaDataCol"

Check the managed property name of the managed meta data column in central administrator, for this column it is like: owstaxIdTestCPBx0020ManagedMetaDataCol

Remove the "owstaxId" from this and use following as title: TestCPBx0020ManagedMetaDataCol

< FilterCategories > 

< Category    Title="TestCPBx0020ManagedMetaDataCol"    Description="Managed metadata of the documents"    Type="Microsoft.Office.Server.Search.WebControls.TaxonomyFilterGenerator"    MetadataThreshold="3"    NumberOfFiltersToDisplay="3"    MaxNumberOfFilters="20"    ShowMoreLink="True"    MappedProperty="ows_MetadataFacetInfo"    MoreLinkText="show more"    LessLinkText="show fewer" />


</ FilterCategories > 

This will show only the managed metadata column in search refinement panel filter.


Use of Custom search refinement panel and Content Type in SharePoint 2010

To show the "Content Type" in the "Search Refinement Panel", there are following steps:

1. In Search, default managed property of "Contetnt Type" doesn't work so it requires to create a new managed property and mapped to following crawl properties: ows_ContentType’ and ‘Basic:5’.

2. Run full crawl.

3. Add following xml in refinement panel xml: For example the new content type created is named "SearchContentType" :

< Category    Title="Content Type"    
Description="The Content Type of the item"    Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator"    MetadataThreshold="3"    NumberOfFiltersToDisplay="3"    MaxNumberOfFilters="20"    ShowMoreLink="True"    MappedProperty="SearchContentType"    
MoreLinkText="show more"    LessLinkText="show fewer" />


Now Content Type will start coming in the search page refinement panel.



Wednesday, November 06, 2013

Custom search page with search refinement panel in SharePoint 2010

I want to share my experience with custom search page and search refinement panel web part with all of you.
To create a new search page,

1.       Create a new search Page. Add the web parts -search refiner, search pagination, search statistics, search result

2.       Change the search settings page and add the new search page: 

Go to site settings and go to Search settings from Site collection Administration –
  



Select “Do Not use custom scopes..”

Write the new custom search result page location in “site collection search results page”.




3.       In The search Page, edit the page. edit the search refiner- Refinement panel xml:





And now onwards for every search in the site, the search result page will be redirected to this new search page.

I am back..

Hello Everyone,

Thanks for reading my blogpost.

I was away from blogging since long due to my laziness and family reasons. Well I want to inform my readers that I am working in SharePoint since long (almost 5 years) so will be sharing my experiences with all of you.

Enjoy Reading..