title: Can't add to Solr index - document is missing uniqueKey field?
body: <p>I'm using SolrNET to manage my Solr index. After I updated the schema with a new uniqueKey field called "guid", I can't add documents to Solr.</p>
  
  <p>This is the Tomcat log error:</p>
  
  <blockquote>
    <p>org.apache.solr.common.SolrException: Document is missing uniqueKey field guid</p>
  </blockquote>
  
  <p>I'm adding an object like this to Solr:</p>
  
  <pre><code>return new T()
              {
                  GUID = Guid.NewGuid().ToString(),
                  Id = reader.GetInt32(0),                
                  Heading = reader.GetString(1),
                  Body = freeText,
                  ForumRoom = reader.GetInt32(3),
                  ForumTopicId = reader.GetInt32(9),
                  SearchObjectType = reader.GetBoolean(5) ? SearchBase.ObjectType.ForumReply.ToString() : SearchBase.ObjectType.ForumTopic.ToString(),
                  Date = reader.GetDateTime(6)
              };
  </code></pre>
  
  <p>The strange thing, this works perfectly well when testing local, however doesn't work at all live.</p>
  
  <p>This is what the schema.config looks like:</p>
  
  <pre><code>&lt;fields&gt;
        &lt;field name="id" type="int" indexed="true" stored="true" required="true" /&gt;
        &lt;field name="searchobjecttype" type="string" indexed="true" stored="true" required="true" /&gt;
        &lt;field name="heading" type="text" indexed="true" stored="false" required="false" /&gt;
        &lt;field name="body" type="text" indexed="true" stored="false" required="false" /&gt;
        &lt;field name="locationid" type="int" indexed="true" stored="true" required="false" /&gt;
        &lt;field name="currentlocationid" type="int" indexed="true" stored="true" required="false" /&gt;
        &lt;field name="countryid" type="int" indexed="true" stored="true" required="false" /&gt;
        &lt;field name="currentcountryid" type="int" indexed="true" stored="true" required="false" /&gt;
        &lt;field name="forumroom" type="int" indexed="true" stored="true" required="false" /&gt;
          &lt;field name="forumtopicid" type="int" indexed="true" stored="true" required="false" /&gt;
        &lt;field name="dt" type="date" indexed="true" stored="false" required="false" /&gt;
        &lt;field name="txt" type="text" indexed="true" stored="true" multiValued="true" /&gt;
        &lt;field name="guid" type="string" indexed="true" stored="true" required="false" /&gt;
    &lt;/fields&gt;
        &lt;copyField source="id" dest="txt" /&gt;
        &lt;copyField source="searchobjecttype" dest="txt" /&gt;
        &lt;copyField source="heading" dest="txt" /&gt;
        &lt;copyField source="body" dest="txt" /&gt;
        &lt;copyField source="locationid" dest="txt" /&gt;
        &lt;copyField source="currentlocationid" dest="txt" /&gt;
        &lt;copyField source="countryid" dest="txt" /&gt;
        &lt;copyField source="currentcountryid" dest="txt" /&gt;
        &lt;copyField source="forumroom" dest="txt" /&gt;
        &lt;copyField source="forumtopicid" dest="txt" /&gt;
        &lt;copyField source="dt" dest="txt" /&gt;
        &lt;uniqueKey&gt;guid&lt;/uniqueKey&gt;
        &lt;defaultSearchField&gt;txt&lt;/defaultSearchField&gt;
        &lt;solrQueryParser defaultOperator="AND" /&gt; 
  </code></pre>
  
  <p>What am I missing?</p>