What you can do is override the Smart Search Content indexer (see example below), find the Content Rating for the document and add it as a searchable field. Then add a hidden Smart Search Filter that adds boosted weights based on the Rating, like the below:
ContentRating('five')^2 ContentRating('four')^1.5 ContentRating('three')^1 ContentRating('two')^.5 ContentRating('one')^.25
This would add heavier weights to higher rated content.
using CMS.Base;
using CMS.DocumentEngine;
using CMS.Membership;
using System.Collections.Generic;
[SmartSearchContentLoader]
public partial class CMSModuleLoader
{
/// <summary>
/// Attribute class for assigning event handlers.
/// </summary>
private class SmartSearchContentLoaderAttribute : CMSLoaderAttribute
{
/// <summary>
/// Called automatically when the application starts.
/// </summary>
public override void Init()
{
// Assigns a handler to the GetContent event for pages
DocumentEvents.GetContent.Execute += OnGetPageContent;
}
private void OnGetPageContent(object sender, DocumentSearchEventArgs e)
{
// Gets an object representing the page that is being indexed
TreeNode indexedPage = e.Node;
// Checks that the page exists
if (indexedPage != null)
{
// Get the content rating here
float ContentRating = GetThePageContentRating(e.Node);
string WordContentRating = "";
if(ContentRating >4) {
WordContentRating = "five";
} else if(ContentRating >3) {
WordContentRating = "four";
} else if(ContentRating >2) {
WordContentRating = "three";
} else if(ContentRating >1) {
WordContentRating = "two";
} else {
WordContentRating = "one";
} else
// Adds the value as a searchable/filterable/weightable field
e.SearchDocument.AddGeneralField("ContentRating", WordContentRating), true, false);
}
}
}
}