Gravatar for anastasiyar29@gmail.com

Question by anastasiyar29, Dec 1, 2017 8:58 PM

How to configure Facet component to respect multi value fields?

Hello,

I have a computed field that joins multiple values separated by semicolons

<field fieldName="industrylist" isMultiValue="true" isFacet="true" returnType="System.String" patch:source="Atlas.SEF.Coveo.config">Path.To.Class.IndustryComputedField</field>

I am using CoveoFacet, and it's configured to be multi-field

<div class="CoveoFacet" data-field="@findustrylist30698" data-title="Industry" data-enable-facet-search="false" data-enable-collapse="false" data-enable-settings-facet-state="false" data-number-of-values="10" data-include-in-breadcrumb="true" data-id="industrylist" data-is-multi-value-field="true" data-enable-settings="false">…</div>

However, the facet is rendered like this:

Eco;Aerospace & Defense;Appliance;Automotive;Construction & Infrastructure
Eco;Automotive

Can you please tell me what else I need to change to make the multi values facets work?

Thank you!

Gravatar for flguillemette@coveo.com

Comment by François Lachance-Guillemette, Dec 1, 2017 9:07 PM

Everything looks fine, can you validate in the Coveo Cloud Administration Console, under the "Fields" section that your field really is checked "Multi-Value Facet" ?

Have you rebuilt since you set `isMultiValue="true"`?

1 Reply
Gravatar for flguillemette@coveo.com

Answer by François Lachance-Guillemette, Dec 1, 2017 9:37 PM

I suspect that your issue is that you configured `isMultiValue` in your computed field configuration, but this option should be set in the `fieldMap` node instead.

Example:

<fields hint="raw:AddComputedIndexField">
  <field fieldName="industrylist" returnType="System.String" patch:source="Atlas.SEF.Coveo.config">Path.To.Class.IndustryComputedField</field>
</fields>
<fieldMap type="Coveo.Framework.Fields.CoveoFieldMap, Coveo.Framework">
  <fieldNames hint="raw:AddFieldByFieldName">
    <fieldType fieldName='industryList' isMultiValue="true" />
  </fieldNames>
</fieldMap>

See this page for more information about field configuration.

Ask a question