How to search tags and other custom classification fields po

Posted by Community Admin on 04-Aug-2018 21:20

How to search tags and other custom classification fields post 7.3

All Replies

Posted by Community Admin on 19-Mar-2015 00:00

I having issues implementing a text search for Tags and other flat classification fields that are part of a dynamic content item post 7.3.  Right now I'm using a list of strings and then building the query.  Title and Description are text fields and those work, however I'm not sure how to search the title of the classifications.  In this example, 'Tags' is the built in classification and 'holidays' is a custom flat taxonomy.

 

Note I have added these fields as searchable in this particular index.

List<String> searchFields = new List<string> "Title", "Description", "Tags", "holidays";
var searchService = Telerik.Sitefinity.Services.ServiceBus.ResolveService<ISearchService>();
 var queryBuilder = ObjectFactory.Resolve<IQueryBuilder>();
 var searchQuery = queryBuilder.BuildQuery(searchTerm, searchFields.AsEnumerable());
 searchQuery.IndexName = "content";
IResultSet contentResults = searchService.Search(searchQuery);

This thread is closed