Home

Tuesday, December 02, 2008

Introduction As for a document appearing in SharePoint 3.0 search results; the standard formatting includes a hyperlink to open the document. However, you may want your search results to also include a link to open the display form or edit form of the document's associated list item. This way users have the options of opening a document as well as viewing and editing document properties all from the search results page.

Step 2. Create a Managed Property for the Document's List Item ID* SharePoint Shared Services Administration > Search Settings > Metadata Property Mappings > Managed Properties * New Managed Property Name and typeProperty Name: OWSIDInteger Description: The type of information in this property: Integer Mappings to crawled properties: Select - Include values from a single crawled property based on the order specifiedCrawled properties mapped to this managed property: OWS_ID(Integer)Use in scopes: No - Do not allow this property to be used in scopes

Step 3. Run a Full Crawl

* SharePoint Shared Services Administration > Search Settings > Content sources and crawl schedules > For each applicable content source, invoke the context menu and Start Full CrawlStep 4. Make the New Managed Property Part of the Search Query

Step 5. Make the Managed Property Display in the Search Results5A. Create an XML File Containing the Raw XML Representation of the Search Results* Open an XML editor such as Visual Studio* File > New > File > XML File* Search Center > Perform a search (the results should still be coming back as raw XML)* Copy the search results into the XML file* Save the XML file to be used in Step 5B

5B. Create a new XSL Stylesheet* Create a test site* Add a Data View Web Part (DVWP) to the Test Site* SharePoint Designer > Open test site > Open default.aspx* Split View* Menu > Insert > SharePoint Controls > Data View* Data Source Library > XML Files > Add an XML file:Upload the XML file from Step 5A* Drag the content from the new data source to the DVWP* Format the DVWP accoding to the desired look and feel for search results* When look and feel is complete, open the XML editor and create a new XML file:Visual Studio > File > New > File > XML File* SharePoint Designer > Highlight the DVWP in the Design window* Copy the code for the DVWP from the Code view* Paste the XML into the new XML file* Identify the XSL Stylesheet portion of the XML* Cut away any unnecessary XML from the file, leaving only the XSL Stylesheet* Save the XML file to be used in Step 5C