title: Configuring Solr to use UUID as a key
body: <p>I am trying to configure Solr 4 to work with UUID and so far I am unsuccessful</p>
  
  <p>From reading the documentation I have seen two different ways to configure schema.xml to work with UUID (both do not work)</p>
  
  <p>for both I need to write</p>
  
  <pre><code>&lt;fieldType name="uuid" class="solr.UUIDField" indexed="true" /&gt;
  </code></pre>
  
  <p>option 1: 
  add:</p>
  
  <pre><code>&lt;field name="id" type="uuid" indexed="true" stored="true" default="NEW" multiValued="false"/&gt;
  </code></pre>
  
  <p>and make sure to remove the line </p>
  
  <pre><code>&lt;uniqueKey&gt;id&lt;/uniqueKey&gt;
  </code></pre>
  
  <p>option 2
  add:</p>
  
  <pre><code>&lt;field name="id" type="uuid" indexed="true" stored="true" required="true" multiValued="false" /&gt; 
  </code></pre>
  
  <p>Both options are not working correctly and returning
  org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Error initializing QueryElevationComponent.</p>
  
  <p>I also tried adding a row to the colrconfig.xml file with the configuration:</p>
  
  <pre><code>&lt;updateRequestProcessorChain name="uuid"&gt;
  &lt;processor class="solr.UUIDUpdateProcessorFactory"&gt; 
      &lt;str name="fieldName"&gt;uniqueKey&lt;/str&gt; 
  &lt;/processor&gt;    
  &lt;processor class="solr.RunUpdateProcessorFactory" /&gt;
  &lt;/updateRequestProcessorChain&gt;
  </code></pre>
  
  <p>Thanks,</p>
  
  <p>Shimon</p>