Gravatar for david.masters1984@gmail.com

Question by David Masters, Mar 3, 2017 11:20 AM

Error: The field must be configured as facet - when trying to create 'specific field contains string' rule

I'm trying to create a listing page with criteria defined as a rule.

I have a field that is configured as a facet in config:

<fieldType fieldName="_promotionReferences" isFacet="true" isSortable="false" isMultiValue="true" settingType="Coveo.Framework.Configuration.FieldConfiguration, Coveo.Framework" />

And I'm defining my rule as:

Rule

But when I go to experience editor, I see the following:

alt text

I have also tried adding a facet item for the field in sitecore (via System > Settings > Buckets > Facets) but this doesn't fix the issue either.

What am I doing wrong?

Gravatar for flguillemette@coveo.com

Comment by François Lachance-Guillemette, Mar 3, 2017 11:35 AM

Did you rebuild or reindex an item after setting the field as a facet? This should synchronize the field configuration.

Gravatar for david.masters1984@gmail.com

Comment by David Masters, Mar 3, 2017 11:56 AM

Yeah I have rebuilt the indexes. Just tried again - still no joy..

Gravatar for slangevin@coveo.com

Comment by Simon, Mar 3, 2017 1:37 PM

Is this a single CM instance, with no CDs?

Gravatar for david.masters1984@gmail.com

Comment by David Masters, Mar 3, 2017 2:41 PM

Yeah, just my local Dev environment

Gravatar for david.masters1984@gmail.com

Comment by David Masters, Mar 8, 2017 11:15 AM

Anyone able to help with this?

I have used the same rule before against the sitecore path field and it seemed to work fine. Comparing the field configuration in Coveo between the path and my field I cannot see a difference.

I have also tried making this not a multi value field and having a comma deliminated string instead but to no avail.

Gravatar for flguillemette@coveo.com

Comment by François Lachance-Guillemette, Mar 8, 2017 11:35 AM

I went back and see what are the conditions for this error to appear, in this order:

  • The operator must be one that needs the field to be facet
  • The field must be isFacet="true" in the fieldMap and have the same field name (should ignore case).
  • If the above fails, we fallback to check if a facet item exists with its Sitecore item "Field Name" is set to "_promotionreferences" (case is important)

So one of the last two conditions are failing for you.

Could you check in the showconfig if the field is defined correctly? Or if it is defined twice?

Plus I would double-check casing, as you have "promotionReferences" in the fieldmap but "promotionreferences" in the rule.

Gravatar for slangevin@coveo.com

Comment by Simon, Mar 8, 2017 1:33 PM

Is this a cloud or on-premises instance? Do you see the facet property on the field?

1 Reply
Gravatar for david.masters1984@gmail.com

Answer by David Masters, Mar 9, 2017 10:37 AM

Thanks for your help. I have changed the case to match what's in config and it now works fine

I used the autocomplete feature of the rules engine which only returns lowercase names - I guess it's probably sensible to just use lowercase in config.

Ask a question