I have extended the sitefinity search engine to filter search results by Categories. I found a blog by sitefinity which described how to do this but it's very outdated (2012).
The documentation for building a search query does not really exist but I managed to implement it anyway, I thought it could be helpfull to share this information.
The setup is basically the same as in the blog, only the code for building the query changes:
var searchFields =
var searchService = Telerik.Sitefinity.Services.ServiceBus.ResolveService<ISearchService>();
var queryBuilder = ObjectFactory.Resolve<IQueryBuilder>();
var query = queryBuilder.BuildQuery(term, searchFields);
query.Skip = skip;
query.Take = take;
var CategoryGroup =
Terms = categories.Select(c =>
SearchTerm Field =
, Value = c ),
Operator = QueryOperator.Or,
var SearchGroup = query.SearchGroup;
 SearchGroup, CategoryGroup,
Operator = QueryOperator.And
var result = searchService.Search(query);
hitcount = result.HitCount;
I know this is an old post but I would appreciate any sort of feedback here. I managed to successfully compile and install the above custom search widget into my sitefinity website. I am running Sitefinity 8.0 for what its worth. However, it seems the search is not filtering by category because when I search a term, its returning all the files with the term in it regardless of whether they are in the specified category or not. Any insight?
I'm using the code exactly as above. I made sure to create a search index, to categorize my files, and to reindex.
How do I fix the assembly references which was explained in the blog?