title: SOLR mysql DataImport missing mandatory uniqueKey field: id
body: <p>I'm new to SOLR.  Using DataImporter to bring MySQL records in for indexing.  Import works, but 0 Documents get created.  I'm seeing the following error: </p>
  
  <blockquote>
    <p>org.apache.solr.common.SolrException: Document is missing mandatory uniqueKey field: id</p>
  </blockquote>
  
  <p>My data-config.xml looks as follows:</p>
  
  <pre><code>&lt;dataConfig&gt;  
  &lt;dataSource type="JdbcDataSource" driver="org.gjt.mm.mysql.Driver" url="jdbc:mysql://localhost/gartner" user="" password="" batchSize="-1" /&gt;  
  &lt;document name="inquiries"&gt;
      &lt;entity name="inquiry_data" query="SELECT * FROM research_srv_req"&gt;
          &lt;field column="reference_id" name="reference_id" /&gt;
          &lt;field column="type" name="type" /&gt;
          &lt;field column="sub_type" name="sub_type" /&gt;
          &lt;field column="subject" name="inquiry_subject" /&gt;
          &lt;field column="advice" name="advice" /&gt;
          &lt;field column="client_question" name="client_question" /&gt;
          &lt;field column="decision_stage_desc" name="decision_stage_desc" /&gt;
          &lt;field column="acct_name" name="acct_name" /&gt;
          &lt;field column="acct_sic_type" name="acct_sic_type" /&gt;
          &lt;field column="acct_sic_sub_type" name="acct_sic_sub_type" /&gt;
          &lt;field column="enterprise_sic_type" name="enterprise_sic_type" /&gt;
          &lt;field column="enterprise_sic_sub_type" name="enterprise_sic_sub_type" /&gt;
          &lt;field column="client_job_title" name="client_job_title" /&gt;
      &lt;/entity&gt;  
  &lt;/document&gt;  
  </code></pre>
  
  <p></p>
  
  <p>and I added the following to my schema.xml file:</p>
  
  <pre><code>&lt;field name="reference_id" type="int" indexed="true" stored="true" required="true" multiValued="false" /&gt;
  &lt;field name="type" type="string" indexed="true" stored="true" required="true" multiValued="false" /&gt;
  &lt;field name="sub_type" type="string" indexed="true" stored="true" required="true" multiValued="false" /&gt;
  &lt;field name="inquiry_subject" type="string" indexed="true" stored="true" required="true" multiValued="false" /&gt;
  &lt;field name="advice" type="string" indexed="true" stored="true" required="true" multiValued="false" /&gt;
  &lt;field name="client_question" type="string" indexed="true" stored="true" required="true" multiValued="false" /&gt;
  &lt;field name="decision_stage" type="string" indexed="true" stored="true" required="true" multiValued="false" /&gt;
  &lt;field name="acct_name" type="string" indexed="true" stored="true" required="true" multiValued="false" /&gt;
  &lt;field name="acct_sic_type" type="string" indexed="true" stored="true" required="true" multiValued="false" /&gt;
  &lt;field name="acct_sic_sub_type" type="string" indexed="true" stored="true" required="true" multiValued="false" /&gt;   
  &lt;field name="enterprise_sic_type" type="string" indexed="true" stored="true" required="true" multiValued="false" /&gt; 
  &lt;field name="enterprise_sic_sub_type" type="string" indexed="true" stored="true" required="true" multiValued="false" /&gt; 
  &lt;field name="client_job_title" type="string" indexed="true" stored="true" required="true" multiValued="false" /&gt;
  </code></pre>
  
  <p>The original schema.xml also had the following line:</p>
  
  <pre><code>&lt;uniqueKey&gt;id&lt;/uniqueKey&gt;
  </code></pre>
  
  <p>I tried changing id to reference_id which is the unique column in my database, but then SOLR fails to load with the following stack dump:</p>
  
  <blockquote>
    <p>message {msg=SolrCore 'collection1' is not available due to init failure: Error initializing QueryElevationComponent.,trace=org.apache.solr.common.SolrException: SolrCore 'collection1' is not available due to init failure: Error initializing QueryElevationComponent. at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:860) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:251) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:158) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Unknown Source) Caused by: org.apache.solr.common.SolrException: Error initializing QueryElevationComponent. at org.apache.solr.core.SolrCore.(SolrCore.java:835) at org.apache.solr.core.SolrCore.(SolrCore.java:629) at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:622) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:657) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:364) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:356) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ... 1 more Caused by: org.apache.solr.common.SolrException: Error initializing QueryElevationComponent. at org.apache.solr.handler.component.QueryElevationComponent.inform(QueryElevationComponent.java:240) at org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:601) at org.apache.solr.core.SolrCore.(SolrCore.java:830) ... 13 more Caused by: java.lang.NumberFormatException: For input string: "MA147LL/A" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at org.apache.solr.schema.TrieField.readableToIndexed(TrieField.java:387) at org.apache.solr.schema.TrieField.readableToIndexed(TrieField.java:378) at org.apache.solr.handler.component.QueryElevationComponent$ElevationObj.(QueryElevationComponent.java:136) at org.apache.solr.handler.component.QueryElevationComponent.loadElevationMap(QueryElevationComponent.java:309) at org.apache.solr.handler.component.QueryElevationComponent.inform(QueryElevationComponent.java:223) ... 15 more ,code=500}
    description The server encountered an internal error ({msg=SolrCore 'collection1' is not available due to init failure: Error initializing QueryElevationComponent.,trace=org.apache.solr.common.SolrException: SolrCore 'collection1' is not available due to init failure: Error initializing QueryElevationComponent. at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:860) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:251) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:158) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Unknown Source) Caused by: org.apache.solr.common.SolrException: Error initializing QueryElevationComponent. at org.apache.solr.core.SolrCore.(SolrCore.java:835) at org.apache.solr.core.SolrCore.(SolrCore.java:629) at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:622) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:657) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:364) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:356) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ... 1 more Caused by: org.apache.solr.common.SolrException: Error initializing QueryElevationComponent. at org.apache.solr.handler.component.QueryElevationComponent.inform(QueryElevationComponent.java:240) at org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:601) at org.apache.solr.core.SolrCore.(SolrCore.java:830) ... 13 more Caused by: java.lang.NumberFormatException: For input string: "MA147LL/A" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at org.apache.solr.schema.TrieField.readableToIndexed(TrieField.java:387) at org.apache.solr.schema.TrieField.readableToIndexed(TrieField.java:378) at org.apache.solr.handler.component.QueryElevationComponent$ElevationObj.(QueryElevationComponent.java:136) at org.apache.solr.handler.component.QueryElevationComponent.loadElevationMap(QueryElevationComponent.java:309) at org.apache.solr.handler.component.QueryElevationComponent.inform(QueryElevationComponent.java:223) ... 15 more ,code=500}) that prevented it from fulfilling this request.</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>