Note that there are some explanatory texts on larger screens.

plurals
  1. POSolr fails with "missing required unique key id" error
    primarykey
    data
    text
    <p>There were a few questions on the similar topic but their resolutions do not seem to fit my case.</p> <p>Env: Solr4.2.1, Tomcat 7</p> <p>I am trying to index public movielens data, and started (as everybody) with the 'example' core. I have removed some fields from the schema not relevant to me, and added others to index movielens fields:</p> <pre><code>&lt;field name="id" type="string" indexed="true" required="true" stored="true" multiValued="false" /&gt; &lt;!-- fields for u.data in the grouplens data --&gt; &lt;field name="user_number" type="string" indexed="true" stored="true" multiValued="false" /&gt; &lt;field name="item_number" type="text_general" indexed="true" stored="true"/&gt; &lt;field name="rating" type="int" indexed="true" stored="true" /&gt; &lt;field name="timestamp" type="date" indexed="true" stored="true"/&gt; &lt;!-- end of fields for u.data in the grouplens data --&gt; &lt;!-- fields for u.user in the grouplens data , userid is already specified above --&gt; &lt;field name="age" type="int" indexed="true" stored="true" /&gt; &lt;field name="gender" type="text_general" indexed="true" stored="true"/&gt; &lt;field name="occupation" type="text_general" indexed="true" stored="true"/&gt; &lt;field name="zipcode" type="text_general" indexed="true" stored="true"/&gt; &lt;!-- end of fields for u.user in the grouplens data --&gt; ... &lt;uniqueKey&gt;id&lt;/uniqueKey&gt; </code></pre> <p>I am adding all fields in my Java indexer, including a generated 'id' field, I am also printing out each field I am adding , so from the console output below you can see that I indeed add the 'id' field, along with others... Yet, I am getting the following error:</p> <pre><code>May 5, 2013 9:43:06 AM org.apache.solr.client.solrj.impl.HttpClientUtil createClient INFO: Creating new http client, config:maxConnections=128&amp;maxConnectionsPerHost=32&amp;followRedirects=false indexUserData() started for file: u.user indexUserData() processing line: 1|24|M|technician|85711 adding field: [user_number, 1] adding field: [id, u_user_1] adding field: [age, 24] adding field: [gender, M] adding field: [occupation, technician] adding field: [zipcode, 85711] Exception in thread "main" org.apache.solr.common.SolrException: Document is missing mandatory uniqueKey field: id at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:404) </code></pre> <p>Any idea what I am missing? Thank you! Marina</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload