title: Solr: transform a comma-delimited field during data import
body: <p>I'm working with Solr 3.5.0. I am importing from a JDBC data source and have a delimited field that I would like split into individual values.  I'm using the <code>RegexTransformer</code> but my field isn't being split.  </p>
  
  <h2>sample value</h2>
  
  <pre><code>Bob,Carol,Ted,Alice
  </code></pre>
  
  <h2>data-config.xml</h2>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;dataConfig&gt;
    &lt;dataSource driver="..." /&gt;
    &lt;document&gt;
      &lt;entity name="ent"
              query="SELECT id,names FROM blah"
              transformer="RegexTransformer"&gt;
        &lt;field column="id" /&gt;
        &lt;field column="names" splitBy="," /&gt;
      &lt;/entity&gt;
    &lt;/document&gt;
  &lt;/dataConfig&gt;
  </code></pre>
  
  <h2>schema.xml</h2>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;schema name="mytest" version="1.0"&gt;
    &lt;types&gt;
      &lt;fieldType name="string" class="solr.StrField" sortMissingLast="true"
                 omitNorms="true"/&gt;
      &lt;fieldType name="integer" class="solr.IntField" omitNorms="true"/&gt;
    &lt;/types&gt;
    &lt;fields&gt;
      &lt;field name="id" type="integer" indexed="false" stored="true"
             multiValued="false" required="true" /&gt;
      &lt;field name="name" type="string" indexed="true" stored="true"
             multiValued="true" required="true" /&gt;
    &lt;/fields&gt;
  &lt;/schema&gt;
  </code></pre>
  
  <p>When I search <em>:</em> I get a result <code>doc</code> element like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;doc&gt;
    &lt;int name="id"&gt;22&lt;/int&gt;
    &lt;arr name="names"&gt;
      &lt;str&gt;Bob,Carol,Ted,Alice&lt;/str&gt;
    &lt;/arr&gt;
  &lt;/doc&gt;
  </code></pre>
  
  <p>I was hoping to get this instead:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;doc&gt;
    &lt;int name="id"&gt;22&lt;/int&gt;
    &lt;arr name="names"&gt;
      &lt;str&gt;Bob&lt;/str&gt;
      &lt;str&gt;Carol&lt;/str&gt;
      &lt;str&gt;Ted&lt;/str&gt;
      &lt;str&gt;Alice&lt;/str&gt;
    &lt;/arr&gt;
  &lt;/doc&gt;
  </code></pre>
  
  <p>It's quite possible I misunderstand the <a href="http://wiki.apache.org/solr/DataImportHandler#RegexTransformer" rel="nofollow"><code>RegexTransformer</code></a> section of the wiki.  I've tried changing my delimiter and I've tried using a different field for the parts (as shown in the wiki)...
  </p>
  
  <pre><code>&lt;field column="name" splitBy="," sourceColName="names" /&gt;
  </code></pre>
  
  <p>...but that resulted in an empty <code>name</code> field.  What am I doing wrong?</p>