I've made a computed index field in my solution. The class returns List<string> from the ComputeFieldValue method and the config patch includes the field within the fieldMap and documentOptions sections of the defaultSolrIndexConfiguration.

I'm following the answer provided here: Solr tokenization to split on semicolon character

My indexer class is as follows:

public class SemicolonDelimitedField : AbstractComputedIndexField
 public override object ComputeFieldValue(IIndexable indexable)
  Item item = indexable as SitecoreIndexableItem;
  if (item == null)
    return null;

  if (item.TemplateID != Templates.Category.ID
      && item.TemplateID != Templates.CommerceProduct.ID)
    return null;

  var fieldValue = item[FieldName];
  var values = fieldValue?.Split(new[] {";"}, StringSplitOptions.RemoveEmptyEntries);
  if (values == null || values.Any() == false)
    return null;

  var returnValue = values.Select(v => v.Trim()).ToList();
  return returnValue;

And the config patch is as follows

<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
  <sitecore search:require="solr">
        <defaultSolrIndexConfiguration type="Sitecore.ContentSearch.SolrProvider.SolrIndexConfiguration, Sitecore.ContentSearch.SolrProvider" >
          <fieldMap type="Sitecore.ContentSearch.SolrProvider.SolrFieldMap, Sitecore.ContentSearch.SolrProvider">
            <fieldNames hint="raw:AddFieldByFieldName">
              <field fieldName="myField" returnType="stringCollection" />

          <documentOptions type="Sitecore.ContentSearch.SolrProvider.SolrDocumentBuilderOptions, Sitecore.ContentSearch.SolrProvider">
            <fields hint="raw:AddComputedIndexField">
              <field fieldName="myField" storageType="NO" indexType="UNTOKENIZED">MyNamespace.SemicolonDelimitedField, MyAssembly</field>

What I am seeing in my Solr index is that the computed field does not seem to be breaking up into separate entities in the array e.g.

"myField_sm":["Low level;High level"],

what I was expecting was

"myField_sm":["Low level", "High level"],

I attached the debugger to be 100% sure that a List<string> with two elements was really being returned. What part of the puzzle am I missing?

  • 1
    It doesn't look for me like indexing issue. It looks rather like the field is indexed directly from field value rather than from your custom code. Can you try use completely new name for your custom field in the config and see if that helps?
    – Marek Musielak
    Commented Oct 4, 2020 at 14:59
  • @MarekMusielak that was indeed the issue. If you want to post that suggestion as an answer, I'll be happy to accept it. Commented Oct 5, 2020 at 11:39

1 Answer 1


You wrote in your question that the value which is indexed is

"myField_sm":["Low level;High level"],

It doesn't look like indexing issue. I've never seen Sitecore or Solr adding ";" in document fields.

This looks rather like the field is indexed directly from item field value rather than from your custom code.

Try to use completely new name for your custom field in the config and see if that helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.