1: Add the Document Type managed property to the displayable properties of the Search Core Results Web Part.
2: Modify the XSLT Transformation XML to Display the Document Type Managed Property in the Search Results
3: Modify the XSLT Transformation XML to Remove the URL from the Search Results Metadata
Consider that users want to be able to see the Document Type name for each search result item. In addition, users want to remove the URL listed at the bottom of the summary section of the search result item. The URL confuses the user and inhibits easy reading of the summary document. What to do?
1: Add the Document Type managed property to the displayable properties of the Search Core Results Web Part.
1. Navigate to http://your intranetsite/Search/Pages/results.aspx.
2. Click Site Actions, and then click Edit Page.
3. Locate the Bottom zone in the Web Part page.
4. Locate the Search Core Results Web Part.
5. Hover your mouse over the upper right corner of the Web Part until a down arrow displays. Click the down arrow to display the Web Part menu.
6. Click Edit Web Part.
7. Locate page the Search Core Results tool pane in the upper right corner of the Web Part.
8. Expand the Display Properties section.
9. Uncheck the Use Location Visualization check box.
10. Copy the text in the Fetched Properties text box into Notepad.
11. Add <Column Name="DocumentType"/>to the end of the text before closing the </Columns>XMLelement.
12. Replace the existing text with a copy of all the text from Notepad to the Fetched Properties text box in the Search Core Results Web Part.
13. Click the Apply button.
14.Check and then uncheck the Use Location Visualization check box to enable the XSL Editor button for the next exercise.
2: Modify the XSLT Transformation XML to Display the Document Type Managed Property in the Search Results
1. Click the XSL Editor … button to open the XSLT transformation XML.
2. Locate the <div class=”srch-Metadata2”> element in the editor.
3. Insert the following XSLtemplate at the indicated location:
<xsl:call-template name="DisplayString">
<xsl:with-param name="str" select="documenttype" />
</xsl:call-template>
4. Click the Save button.
5. Click the OK button from the Search Core Results tool pane.
6. Click the Save and Close ribbon button to save and close the results.aspx page.
3: Modify the XSLT Transformation XML to Remove the URL from the Search Results Metadata
1. Click the XSL Editor … button to open the XSLT transformation XML.
2. Locate the <p class="srch-Metadata1">element in the editor.
3. Remove the span element as indicated by the highlight.
4. Click the Save button.
5. Click the OK button of the Search Core Results tool pane.
6. Click the Save and Close ribbon button to save and close the results.aspx page.
7. Type Microsoft in the Search box and execute a search to see the content type in the summary section of the results. Note that the URL is not displayed at the bottom of the metadata summary.
No comments:
Post a Comment