Hi Stephen. Jeff told me you needed help, so I figured this out for you.
First you need to make it so the categories are included in the content. If you have already done this, PAY CLOSE ATTENTION TO EXACTLY HOW I DID IT, most importantly the "XX" characters I add to the beginning and end of the CategoryDisplayName in the content.
Edit the file ~/App_Code/Samples/Modules/SampleClassLoaderModule.cs to include this code
public override void Init()
{
DocumentEvents.GetContent.Execute += new EventHandler<DocumentEventArgs>(GetContent_Execute);
}
void GetContent_Execute(object sender, DocumentEventArgs e)
{
// get assigned categories
System.Data.DataSet categories = CMS.SiteProvider.CategoryInfoProvider.GetDocumentCategories(e.Node.DocumentID, String.Empty, String.Empty);
if (!CMS.GlobalHelper.DataHelper.DataSourceIsEmpty(categories))
{
// loop through all categories and add them to the content variable
foreach (System.Data.DataRow category in categories.Tables[0].Rows)
{
//Add XX to the beginning and end of the CategoryDisplayName so that our filter can pin point these category names while ignoring the rest of the content
e.Content = e.Content + " XX" + CMS.GlobalHelper.ValidationHelper.GetString(category["CategoryDisplayName"], "") + "XX";
}
}
}
Next Go to your smart search index that you will be using in your search results web part in Site Manager>Administration>Smart Search. Find your index and rebuild it. This time it will include the categories.
After you have rebuilt your index, create a query for your smart search filter to use.
Go to Site Manager>Development>Document Types>Root (CMS.Root) and select the querys tab.
Add a new query with this text
SELECT '_content', 'XX'+CategoryDisplayName+'XX', CategoryDisplayName FROM CMS_Category WHERE ##WHERE## ORDER BY ##ORDERBY##
Notice that the second column it will return has the 'XX's added before and after the CategoryDisplayName. Also notice the first column value of '_content' this tells the filter that it will be searching the content field of the search index items.
Now go to your search page. Follow some of the instructions on
This Page to get the right web parts on your page. Instead of using the query WHERE condition they mention on that page, use this "CategorySiteID = {%CurrentSite.SiteID%}" and use "CategoryDisplayName" for the ORDER BY. Also, be sure to select the new query that you added earlier instead of the one they mention and make the Filter Mode a dropdownlist instead of a checkbox.
Once you have done all of that, you should be able to search in the dialog and it will only show results that have the selected category assigned to them.
I have this working fine on my local dev site, so let me know if you need any more help.