title: The remote server returned an error: (400) Bad Request. when add docs to index
body: <p>when i add docs to index, the page returns 400 bad request. And the solr has been start up and can get data from database. So i need put the data into index. However, it's failed always.</p>
  
  <hr>
  
  <p>1) Here is code snippet of SolrBaseRepository  </p>
  
  <pre><code>/// &lt;summary&gt;    
  /// Base repository for Solr    
  /// &lt;/summary&gt;  
  public class SolrBaseRepository  
  {    
      /// &lt;summary&gt;    
      /// New instance of Solr    
      /// &lt;/summary&gt;    
      /// &lt;typeparam name="T"&gt;Specific type&lt;/typeparam&gt;  
      public class Instance&lt;T&gt;    
      {    
          /// &lt;summary&gt;  
          /// Start Solr instance for a specific type  
          /// &lt;/summary&gt;  
          public void Start()  
          {  
              var instances = Startup.Container.GetAllInstances(typeof (ISolrOperations&lt;T&gt;));  
  
              if (instances.Count() == 0)  
              {  
                  Startup.Init&lt;T&gt;(Toolbox.SolrUrl);  
              }  
          }  
  
      }  
  }  
  </code></pre>
  
  <p>2) here is main part of schemal.xml</p>
  
  <pre><code>&lt;fields&gt;    
      &lt;field name="id" type="int" indexed="true" stored="true" required="true" /&gt;   
      &lt;field name="firstname" type="text" indexed="true" stored="false"required="false" /&gt;   
      &lt;field name="lastname" type="text" indexed="true" stored="false" required="false" /&gt;  
      &lt;field name="position" type="text" indexed="true" stored="false" required="false" /&gt;  
      &lt;field name="text" type="text" indexed="true" stored="false" multiValued="true" /&gt;  
  &lt;/fields&gt;  
  &lt;copyField source="firstname" dest="text" /&gt;    
  &lt;copyField source="lastname" dest="text" /&gt;    
  &lt;copyField source="position" dest="text" /&gt;    
  &lt;uniqueKey&gt;id&lt;/uniqueKey&gt;    
  &lt;defaultSearchField&gt;text&lt;/defaultSearchField&gt;    
  &lt;solrQueryParser defaultOperator="AND" /&gt;     
  </code></pre>
  
  <p>3) solrurl: <code>http://localhost:8080/solr</code></p>
  
  <pre><code>&lt;appSettings&gt;  
  &lt;add key="SolrUrl" value="http://localhost:8080/solr"/&gt;  
  &lt;/appSettings&gt;  
  </code></pre>
  
  <p>4) error is here:  </p>
  
  <pre><code>/// &lt;summary&gt;  
  /// Add all players to the index  
  /// &lt;/summary&gt;  
  public void IndexPlayers()  
  {  
      new SolrBaseRepository.Instance&lt;Player&gt;().Start();  
  
      var solr = ServiceLocator.Current.GetInstance&lt;ISolrOperations&lt;Player&gt;&gt;();  
      var players = new PlayerRepository().GetPlayers();  
  
      **solr.Add(players);** // The remote server returned an error: (400) Bad Request.   
      solr.Commit();  
  }  
  </code></pre>