Advanced query syntax in Search API does not work after upgrade to v8.5

  • Updated

Advanced (or metadata) query syntax using Search API does not work after upgrading to 8.5. The advanced query syntax (using the @ symbol) was used by the Microsoft Indexing service to search on metadata such as TaxCategory. With CMS400.Net V8.5, Ektron uses Microsoft Search Server as the search platform. In version CMS400.Net 8.5, the advanced query search syntax should be converted to its corresponding Search Server equivalent using the new Framework Search APIs.

Following code does not yield results after upgrading to CMS400.Net version 8.5

IndexSearchRequestData requestData = new IndexSearchRequestData();
requestData.LanguageID = 1033;
requestData.XmlConfigID = 10;
requestData.SearchType = WebSearchType.none;
requestData.SearchText = "( @TaxCategory \"\\Ektron Products\\CMS400.Net\\XML\\" ) and ( @book_booktitle_10 american ) ";
int resultCount = 0;
SearchResponseData[] result = search.Search(requestData, HttpContext.Current, ref resultCount);

The advanced query syntax shown above was used by the Microsoft Indexing service to search on metadata such as TaxCategory. With CMS400.Net V8.5, Ektron uses Microsoft Search Server as the search platform. For search to bring back results in 8.5, the Indexing Service query using the old the Search API code should be converted to its corresponding Search Server equivalent using the new Framework Search API as shown below.

     

      using System;
      using System.Collections.Generic;
      using System.Web;
      using Ektron.Cms;
      using Ektron.Cms.Search.Expressions;

      using Ektron.Cms.Search;
      using Ektron.Cms.Search.Compatibility;
      using Ektron.Cms.Framework.Search;

      KeywordSearchCriteria criteria = new KeywordSearchCriteria();
        criteria.IncludeSuggestedResults = false;
        criteria.ImplicitAnd = true;
        criteria.ReturnProperties = new HashSet