Wednesday 31 October 2012

SharePoint publishing content tagging for search

Hi All, 

 I am quite happy to write to my first blog on my most recent success in SharePoint!!! 

Generally you might have come across a requirement where the clients require some kind of tagging for the page content so that its easy for users to search for that content in the site. 

Today I will guide you through the step by step process for doing exactly the same...... 

1. Enabling tagging for the page content so that the content comes on top in search results
2. Enabling clients to tag the page content from the page itself

 Environment: SharePoint 2010, publishing site, site collection already developed

1. There is very cool feature called Enterprise keywords available right out of the box 
2. Go to the root site, site content type gallery
3. Modify the "Page" content type under Publishing Content types.


Page Content type in root site content type gallery
4. Click on Add from existing site columns
5. Add "Enterprise Keywords" existing site column to Page content type.
6. Select Yes for Update all content types inheriting from this type.
7. Click OK.
8. This will add this Enterprise keywords to Page content type and to all other content types that inherit from this Page content type.
9. From this half job is done...

You can test the work so far we did by going to a page in pages library, edit the properties and enter a word in Enterprise Keywords field and check in the page. Do a full crawl of the site and then search with the word you entered in Enterprise Keyword field, now boom... you should get that page at the top of the search result.

10. Now to enable clients to enter/update the tags/keywords on the site, checkout the page layout in SharePoint designer (SPD) 2010.
11. At the end of the register tags, add the following line to register a dll.

<%@ Register Tagprefix="Taxonomy" Namespace="Microsoft.SharePoint.Taxonomy" Assembly="Microsoft.SharePoint.Taxonomy, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

12. And at any convinient location in the page layout, where you want the clients to add/update the tags/keywords add the following 

<Taxonomy:TaxonomyFieldControl FieldName="TaxKeyword" runat="server"></Taxonomy:TaxonomyFieldControl>

13. Check in the page layout and publish..
14. And boom.. now clients can tag the content with keywords from the site itself and can search for them easily....


If's

1. If the search result don't have the expected enterprise keyword's page on top, then it might be the problem with the crawling.
2. Restart the full crawl and see if this fixes the issue
3. If that still didnt, go to crawl history and enter the url of the page (where you entered the enterprise keyword and expecting this to be on top of the search result), and in the links that search crawled, select them and choose to retire those. So that sharepoint will crawl these pages again and now for sure you will have your pages on top of the search result...


Hope this helps at least a few in need...

And if you have any questions leave your comments so that I can reply...