Products and Services
Graffiti CMS
Learn more about our simple content publishing platform.
Harvest Reporting Server
Get business intelligence tools for measuring online behavior.
Professional Services
Consulting, creative, and Web services from the people who know Community Server best.
Solutions
Telligent
Learn more about our team at Telligent.com.
 

Comments and Trackbacks are Included in SearchBarrel-based Search Queries

Problem:

When searching using the default search provider, SearchBarrel, comments and trackbacks are included in the search results when no keywords are provided.

Cause:

The SearchBarrel implementation does not ensure that posts are indexed when performing searches that do not require quering the index.

Solution:

This issue has been resolved.  

To apply the change manually, you can update the CommunityServerSearchBarrel/SearchBarrelProvider.cs file with the following change to line 183.

string searchSQL = "{10} SELECT DISTINCT P.PostID, P.SectionID, Weight = ({0}), P.PostDate FROM {1} cs_Posts P, cs_Sections F  WHERE {2} {3} {4} AND F.SectionID = P.SectionID  AND P.SettingsID = {5}  {7} AND F.IsSearchable = 1 AND P.IsApproved = 1 {6} {8} ORDER BY {9}";

should be replaced with

string searchSQL = "{10} SELECT DISTINCT P.PostID, P.SectionID, Weight = ({0}), P.PostDate FROM {1} cs_Posts P, cs_Sections F  WHERE {2} {3} {4} AND P.IsIndexed = 1 AND F.SectionID = P.SectionID  AND P.SettingsID = {5}  {7} AND F.IsSearchable = 1 AND P.IsApproved = 1 {6} {8} ORDER BY {9}";

The CommunityServer.Components.SearchBarrel.dll assembly shold then be rebuilt and deployed to the bin/ folder of the Community Server web application.