coveo for sitecore: no results for faceted search
I am trying to retrieve facet results from a search using the coveo webservice and soap api. I am able to get expected results using the exact syntax in the tutorial, but as soon as I change the FieldName parameter, I receive no results. To further confuse things, if I use the built-in Sitecore.ContentSearch.Linq methods, facets seem to work as expected (this is not an option for the code; it was more a verification that these values were in fact being tracked.)
This will return facets and counts:
var results = context.GetQueryable
This returns NULL in the result.GroupByResults.DisplayValues field. When I did it with "@sysfiletype" as the FieldName, it behaved as expected (returning facets and counts).
var facet = new GroupByField(); facet.FieldName = "_smorch"; facet.MaxNumberOfGroupByResults = 8; facet.SortCriteria = GroupBySortCriteria.SortByOccurrence; query.GroupByFields = new GroupByFieldV(); query.GroupByFields.Add(facet); var results = service.ExecuteQuery(searchSession, query);
Here is my smorch configuration:
fieldType fieldName="_smorch" isFacet="true" settingType="Coveo.Framework.Configuration.FieldConfiguration, Coveo.Framework" field fieldName="_smorch" type="MyProject.Web.SearchIndices.SmorchField, MyProject.Shared.Sc.Web" returnType="System.String"
Any help will be greatly appreciated.
I think you have a field name translation issue here. If I understand correctly, you used Coveo for Sitecore to index the documents. In that case, the Sitecore field names are translated. The field name "_smorch" in Sitecore will look like "fz95xsmorch12345" in CES.
You should check the field set in the CES Admin Tool and see what the field name is. The field metadata will be "_smorch". Also, the field name changes depending on the database (core, master, web). So you may want to scope your search query to return only results from one database at a time.
Let me know how it goes