Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

SharePoint 2010 Search : Tuning Search (part 3) - The noindex Class & The Ratings Column

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
8/2/2011 3:13:59 PM

6. The noindex Class

One way SharePoint 2010 allows administrators and developers to manage noise in the search engine is by implementing the noindex class value in the HTML of the page. Of course, this works only for web pages or other content written with HTML. Many web pages are largely based on the same templates. These templates include branding and navigation so every web page looks the same or similar and has a similar navigational structure. This is friendly and familiar to web-browsing end users. However, a large number of the important terms for the organization appear on every document. That generates noise in the search engine. Adding this class value to tags in the HTML will tell the crawler not to index the content of those tags and focus only on the terms that appear in the "content" section of the web page.

To include the noindex class, simply find the tag that holds the content that should not be indexed. This is usually a header, footer, news Web Part, or navigation. Add the following values to that tag:

class="noindex"

It should be noted that some nested tags will require their own noindex class to respect the rule. Here is a typical example:

...
<div class="noindex">
<table>
<tr>
<td style="text-align:right;line-height:70%;">
<a href=http://www.prosharepointsearch.com/about.html">About Us</a>
</td>
</tr>
...

7. Popularity (Click-Through)

Although not something that an administrator can actively modify to improve search, click-through relevancy adjustments can improve search without any administrative influence. This "social search" capability records a number of all the clicks for a given query with the document of choice. This document's ranking value is then, over time, increased to improve its ranking. This is an advantage insofar as the search engine learns based on the experience and knowledge of the end users. It relies on the fact that the end users know what they are looking for in respect to the query they made to find it. And they would naturally click the only document that is the correct one for their query. In actual practicality, this is probably not totally true. Users will click in and out of different documents, looking for the right one. This may or may not adversely affect ranking. However, over thousands, if not hundreds of thousands of queries, a useful pattern should emerge that will help ranking, not hinder it.

Should ranking appear to degrade over time, the Search service application can be removed and a new index, database, and ranking values applied to start again. At this point, there is no other way to manually affect this mechanism.

8. Social Tagging

Social tagging is a mechanism in SharePoint to allow users to personalize the content by adding tags to it. The tags can be anything the user wants and are unique to him or her. The tags can affect relevancy as well, helping content be handled by search. The term folksonomy is often applied to this type of user-generated tagging, and it is becoming more and more prevalent on web sites on the Internet. The concept is of a user-generated taxonomy that grows with user experience. Folksonomies can be a useful way to share interests and identify socially interesting concepts but should not be left as the core method for tagging and managing documents' taxonomies. A more managed structure should always be available for end users.

9. The Ratings Column

Although not technically part of adjusting relevancy, the ratings column can allow users to filter on results, along with the other search refinement mechanisms to find documents that are considered valuable by other users. The ratings column is a feature in SharePoint that will allow users to give documents in a given library or items in a list a rating by clicking from one to five stars in a column beside the document. Although this may seem trivial in an organization where all documents have value and purpose, if a given list or library is a collection of information on a given topic, the ratings column can allow users to rate and filter based on that what best represents that topic. The rating values can also be displayed on the results page to allow users to quickly identify which documents were ranked useful by their colleagues.

9.1. Adding a Ratings Column

To add a ratings column to a list or library follow these steps:

  1. Activate the feature at the farm using PowerShell if it isn't already active. Open the SharePoint 2010 Management Shell and call the following (Figure 5):

    Enable-SPFeature Ratings -Url http://server/site/subsite

    Figure 5. Activating the Ratings feature with Windows PowerShell

    NOTE

    SharePoint Team Server Administration (STSADM) is still supported for those more comfortable with it. To enable the feature, run STSADM, which is found in c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN. Find STSADM.exe, and drag it into a command prompt window with the following parameters: STSADM.exe –o activatefeature –name ratings –url http://server/site.

  2. Navigate to the library or list in question, and click the Library tab in the ribbon.

  3. Choose Library Settings in the ribbon, and click "Rating settings" under General Settings (Figure 6).

    Figure 6. Rating settings
  4. Select Yes under "Allow items in this list to be rated?" (Figure 7). SharePoint will automatically apply the ratings column to the library or list.

    Figure 7. Enabling document rating
  5. Run a crawl.

  6. Find the AverageRating crawled property (ows_AverageRating) as shown in Figure 8.

    Figure 8. Crawled ratings properties
  7. Create a property called AvgRating, and map ows_AverageRating to it. It should be a decimal property.

  8. On the crawled property pages that can be accessed by clicking the crawled property in the Metadata Property Mappings page, check "Include values for this property in the search index".

  9. Run a full crawl.

NOTE

Make sure that the property has its values included in the search index. This flag can be set on the crawled property's page. See Figure 9.

Figure 9. Including values in the search index

Figures 19 and 10 are two views of the same mapping, one from the crawled property and one (Figure 10) from the mapped property, which is the one we will eventually call from the user interface. One must be set for mapping the crawled property and the other to include its values in the search index.

Figure 10. Adding the AvgRating metadata mapping

9.2. Displaying Ratings in the Results

The next thing to do is to make this rating value visible in the result list. This will help users identify which documents are rated higher by their peers.

To add the ratings values to display on the results page, do the following:

  1. Navigate to the search results page, and edit the page.

  2. Edit the core search results Web Part.

  3. On the right, expand the Display Properties section, and uncheck Use Location Visualization.

  4. Add the new column to be fetched from the index. Call it <Column Name="AvgRating"/> and place it anywhere in the list as long as it is after the first <Columns> tag and after the closing columns tag and doesn't interfere with the existing entries.

  5. Click XSL Editor. You can now add the XSLT template to control how the stars will be displayed. You should place this in the search results where you want the ratings displayed. A natural place to put it is beside the title. To do this, find the srch-Title3 div tag. Just before this div section closes is the end of the title. It is in the middle of the XSLT and has two closing div tags. Place a call to the template before these closing div tags, as shown in Listing 1.

  6. Save, click OK on the Web Part editing pane, and stop editing the page.

Example 1. XSLT to display the rating stars<!-- Ratings -->
<xsl:choose>
<xsl:when test="avgrating &gt; 0 and avgrating &lt; .75">
<span class="ms-currentRating"><img class="ms-rating_0_5"

src="/_layouts/Images/Ratings.png" alt="Current average rating is half a star."/></span>
</xsl:when>
<xsl:when test="avgrating &gt;= .75 and avgrating &lt; 1.25">
<span class="ms-currentRating"><img class="ms-rating_1"

src="/_layouts/Images/Ratings.png" alt="Current average rating is 1 stars."/></span>

</xsl:when>
<xsl:when test="avgrating &gt;= 1.25 and avgrating &lt; 1.75">
<span class="ms-currentRating"><img class="ms-rating_1_5"

src="/_layouts/Images/Ratings.png" alt="Current average rating is 1.5 stars."/></span>
</xsl:when>
<xsl:when test="avgrating &gt;= 1.75 and avgrating &lt; 2.25">
<span class="ms-currentRating"><img class="ms-rating_2"

src="/_layouts/Images/Ratings.png" alt="Current average rating is 2 stars."/></span>
</xsl:when>
<xsl:when test="avgrating &gt;= 2.25 and avgrating &lt; 2.75">
<span class="ms-currentRating"><img class="ms-rating_2_5"

src="/_layouts/Images/Ratings.png" alt="Current average rating is 2.5 stars."/></span>
</xsl:when>
<xsl:when test="avgrating &gt;= 2.75 and avgrating &lt; 3.25">
<span class="ms-currentRating"><img class="ms-rating_3"

src="/_layouts/Images/Ratings.png" alt="Current average rating is 3 stars."/></span>
</xsl:when>
<xsl:when test="avgrating &gt;= 3.25 and avgrating &lt; 3.75">
<span class="ms-currentRating"><img class="ms-rating_3_5"

src="/_layouts/Images/Ratings.png" alt="Current average rating is 3.5 stars."/></span>
</xsl:when>
<xsl:when test="avgrating &gt;= 3.75 and avgrating &lt; 4.25">
<span class="ms-currentRating"><img class="ms-rating_4"

src="/_layouts/Images/Ratings.png" alt="Current average rating is 4 stars."/></span>
</xsl:when>
<xsl:when test="avgrating &gt;= 4.25 and avgrating &lt; 4.75">
<span class="ms-currentRating"><img class="ms-rating_4_5"

src="/_layouts/Images/Ratings.png" alt="Current average rating is 4.5 stars."/></span>
</xsl:when>
<xsl:when test="avgrating &gt;= 4.75">
<span class="ms-currentRating"><img class="ms-rating_5"v
src="/_layouts/Images/Ratings.png" alt="Current average rating is 5 stars."/></span>
</xsl:when>


<xsl:otherwise>
<b>Not yet rated</b>
<br/>
</xsl:otherwise>
</xsl:choose>
<!-- Ratings End -->

The ratings should now appear on the result list. See Figure 11. This XSLT will check the value of the AvgRating property you have mapped and compare it with ranges between every half unit, starting at three-fourths. This will allow for half ratings based on the decimal values of the ows_AverageRating property, which is an average of all accumulated ratings.

The XSLT uses the built-in image Ratings.png, which is actually a larger image of all ratings stars, and sets them to be displayed using the built-in cascading style sheet (CSS). If the default CSS is changed, the ratings images will not display correctly. There are certainly more clever ways to create this XSLT, but this is a simple start to set the ratings value on the result template.

Figure 11. Ratings shown in the search results


Other -----------------
- SharePoint 2010 Search : Tuning Search (part 2) - The Thesaurus & Custom Dictionaries
- SharePoint 2010 Search : Tuning Search (part 1) - Authoritative Pages & Result Removal
- Automating Dynamics GP 2010 : Using Reminders to remember important events
- Organizing Dynamics GP 2010 : Going straight to the site with Web Links
- Microsoft Lync Server 2010 : Collaboration Benefits & Management and Administration Benefits
- Microsoft Lync Server 2010 : Benefits for Lync Server Users & Enterprise Voice Benefits
- Configuring Role-Based Permissions for Exchange Server 2010 (part 3) - Performing Advanced Permissions Management
- Configuring Role-Based Permissions for Exchange Server 2010 (part 2) - Viewing, Adding or Removing Role Group Members & Assigning Roles Directly or via Policy
- Configuring Role-Based Permissions for Exchange Server 2010 (part 1) - Creating and Managing Role Groups
- Configuring Small Business Server 2011 in Hyper-V : Installation
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server