We are using the Sitecore 8.1, and I have patched a field called categories in the coveo default Index configuration node to make it a facet.
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<coveo>
<defaultIndexConfiguration type="Coveo.AbstractLayer.CoveoDefaultIndexConfiguration, Coveo.AbstractLayer">
<fieldMap type="Coveo.SearchProvider.CoveoFieldMap, Coveo.SearchProvider">
<fieldNames hint="raw:AddFieldByFieldName">
<fieldType patch:before="fieldType[@fieldName='alltemplates']" fieldName="categories" isFacet="true" isExternal="true" isMultiValue="true" settingType="Coveo.Framework.Configuration.FieldConfiguration, Coveo.Framework" />
</fieldNames>
</fieldMap>
</defaultIndexConfiguration>
</coveo>
</sitecore>
</configuration>
After reindexing the web index, I see the categories as facet field on the CES server, and we were able to query it as facet field.
Randomly, this setting is lost on the index server, and it is no more a facet field.
All we have to do is to re-index the web index to make it as a facet field again. Can anyone tell me if I am missing some other configuration in sitecore ?
patch:before
is unnecessary, the order in the fieldMap is not relevant) – flguillemette Apr 7 '17 at 11:51