--- title: Make a Sitecore field multi-value slug: '2377' canonical_url: https://docs.coveo.com/en/2377/ collection: coveo-for-sitecore-v5 source_format: adoc --- # Make a Sitecore field multi-value A Sitecore field can have the [**Multi-value facet**](https://docs.coveo.com/en/1833#facet-and-multi-value-facet) option enabled if it contains a list of semicolon-separated values (semicolon is the default separator). For example, a Sitecore Single-Line Text field containing values `abc;def;ghi` can have this option enabled. > **Important** > > You can only configure multi-value facet fields with strings. > This method won't work to create multi-value fields with integers, floating points, or date/time values. ## Configuring a field as a multi-value facet . Open the `Coveo.SearchProvider.Custom.config` file with a text editor. . In the `fieldMap/fieldNames` element, add the `` element below. Replace `mysitecorefield` with the Sitecore field name (not the [Translated Name](https://docs.coveo.com/en/2551#how-fields-work-behind-the-scenes)). ```xml ``` > **Note** > > The `fieldMap/fieldNames` element is located in the `defaultIndexConfiguration` element. > Field settings defined in the `defaultIndexConfiguration` element are applied to all indexes that reference the `defaultIndexConfiguration` element. > To apply field configurations on a specific index, see [Manage fields for a specific index](https://docs.coveo.com/en/2379/). . Save your changes. . To synchronize these field settings changes into your search indexes, an indexing action must be performed. Alternatively, the `/coveo/api/index/v1/indexes/synchronize` API POST request can be used. You can combine `isMultiValue` with the other settings presented in this section. ## Changing the separator of multi-value fields You can change the default separator (`;`) used for multi-value fields by adding the following element in the `/configuration/sitecore/coveo/defaultIndexConfiguration` element: ```xml YOUR_SEPARATOR_HERE ``` ## Resolving GUIDs in a multi-value facet component An out of the box `C#` class allowing you to retrieve specific fields from an item referenced by a field is already available and supports multi-value fields (see [Coveo.SearchProvider.ComputedFields.ReferencedFieldComputedField](https://docs.coveo.com/en/2623#the-referencedfieldcomputedfield-computed-field)). However, this class only retrieves a field value from the referenced item. In other words, it won't allow you to get the item name, display name or template ID, for example. The following method allows you to retrieve the name of the referenced item. . Implement a computed field that takes care of resolving these GUIDs to specific field values on the referenced item. Here is an example for a field of type Multilist named `MultiSelect`. [source,c#] ``` namespace Coveo.Demos.Fields { public class MultivalueReferenceItemComputedField : IComputedIndexField { /// public string FieldName { get; set; } /// public string ReturnType { get; set; } /// public object ComputeFieldValue(IIndexable p_Indexable) { IIndexableDataField multiValueField = p_Indexable.GetFieldByName("MultiSelect"); if (multiValueField != null) { // The raw value of a Multilist field looks like this: // {F90052A5-B4E6-4E6D-9812-1E1B88A6FCEA}|{F0D16EEE-3A05-4E43-A082-795A32B873C0} // So we split it at the "|" character to retrieve the GUIDs. string[] referencedItemGuids = multiValueField.Value.ToString().Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); List referencedItemNames = new List(); foreach (string referencedItemGuid in referencedItemGuids) { // Then we retrieve the name of each item referenced by these GUIDs. Item item = Context.ContentDatabase.GetItem(new ID(referencedItemGuid)); referencedItemNames.Add(item.Name); } // Finally, we join all those item names using the default separator (;) to get a properly-formatted field. return String.Join(";", referencedItemNames.ToArray()); } return null; } } } ``` . Open the `Coveo.SearchProvider.Custom.config` file with a text editor. . Add the field as a computed field in the configuration under `/coveo/defaultIndexConfiguration/fields[@hint='raw:AddComputedIndexField']`: ```xml Coveo.Demos.Fields.MultivalueReferenceItemComputedField, Coveo.Demos.Fields ``` > **Note** > > If you're unable to find this element, you might need to copy it from the `Coveo.SearchProvider.config` file. > However, don't edit the `Coveo.SearchProvider.config` file, as it may cause issues during upgrades. . [Set this computed field as multi-value](#configuring-a-field-as-a-multi-value-facet) in the Coveo Search Provider configuration file.