How to remove duplicates from Multivalued Fields in SOLR?
<p>I tried the solutions listed in the below question.</p>

<p><a href="https://stackoverflow.com/questions/13306272/removing-solr-duplicate-values-into-multivalued-field">Removing Solr duplicate values into multivalued field</a></p>

<p>I'm using dataimport handler and creating multiple values for the field using RegexTransformer.</p>

<p>My sql returns this for column FOO</p>

<blockquote>
  <p>Johnny Cash, Bonnie Money, Honey Bunny, Johnny Cash</p>
</blockquote>

<p>and I store it to the multivalued field foo using splitBy=","</p>

<pre><code>&lt;field column="FOO" name="foo" splitBy=","/&gt;    
</code></pre>

<p>and it's stored in the multivalued field as such</p>

<blockquote>
  <p>{"Johnny Cash", "Bonnie Money", "Honey Bunny", "Johnny Cash"}</p>
</blockquote>

<p>I've added this to the solrconfig xml</p>

<pre><code>  &lt;updateRequestProcessorChain name="distinctMultiValued" default="true"&gt;
    &lt;!-- To remove duplicate values in a multivalued field--&gt;
    &lt;processor class="DistributedUpdateProcessorFactory"/&gt;
    &lt;processor class="UniqFieldsUpdateProcessorFactory"&gt;
        &lt;str name="fieldRegex"&gt;foo&lt;/str&gt;
    &lt;/processor&gt;
    &lt;processor class="solr.LogUpdateProcessorFactory" /&gt;        
    &lt;processor class="solr.RunUpdateProcessorFactory" /&gt;
  &lt;/updateRequestProcessorChain&gt;
</code></pre>

<p>I've also tried fieldName in place of fieldRegex and tried *oo instead of foo, but the duplicates remain.</p>

<p>Does this have something to do with the RegexTransformer?</p>

<p>I also have an update chain with <code>TrimFieldsUpdateProcessorFactory</code> than runs without any issues.</p>