Microsoft KB Archive/929261

= How to add keyword best bets by using the API in SharePoint Portal Server 2003 =

Article ID: 929261

Article Last Modified on 12/26/2006

-

APPLIES TO


 * Microsoft Office SharePoint Portal Server 2003

-



INTRODUCTION
This article describes how to add keyword best bets by using the API in Microsoft Office SharePoint Portal Server 2003.



MORE INFORMATION
Keywords are special portal areas. To create keywords, add a subarea to the keywords area, as in the following example. Uri uri = &quot;http://ServerURL&quot;; TopologyManager tm = new TopologyManager; PortalSiteCollection sites = tm.PortalSites; PortalContext portalContext = PortalApplication.GetContext(sites[uri]); Guid keywordGuid = AreaManager.GetSystemAreaGuid(portalContext, SystemArea.Keyword); Area keywordArea = AreaManager.GetArea(portalContext, keywordGuid); Area newKeyword = keywordArea.Areas.AddArea(&quot;Test&quot;); keywordArea.Update; //Add synonyms to the newly created keyword newKeyword.AddKeyWord(“String1”); newKeyword.Update; Keyword best bets are the area listings in the keywords area. The code that you use to create a keyword best bet resembles the code that you use to create area listings in an area. For example, the following sample code can be used to create a keyword best bet. // Create guid array that represents the audiences (00000000-0000-0000-0000-000000000000 represents all audiences) Guid[] guidAudiences = new Guid[] { new Guid(&quot;00000000-0000-0000-0000-000000000000&quot;)}; AreaListing myListing = newKeyword.Listings.AddListing(&quot;Title&quot;,&quot;Description&quot;,ListingType.Person,&quot;url&quot;,guidAudiences); myListing.Update(ListingUpdateBehavior.SubmitToSiteRegistry); newKeyword.Update;

Additional query words: SPS

Keywords: kbexpertiseinter kbhowto KB929261

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.