title: Delete index document using solr java api
body: <p>So here i am using <code>solr</code> for indexing document. </p>
  
  <p>now here is my small part code: </p>
  
  <pre><code>        db = cmd.start();
          new NotesSolrWriter(db, null);
          SolrHelper slrHelp = new SolrHelper();
          QueryResponse res = slrHelp.queryResults("dontKnow1 ", null);
          SolrDocumentList ids = res.getResults();
  
          count = ids.size();
          System.out.println(count);
          boolean getServer = getServer();
          if (getServer) {
              for (SolrDocument id : ids) {
                  System.out.println("See my id " + id.toString());
                  FTIserver.deleteById(id.toString());
                  FTIserver.commit();
                  // FTIserver.commit(true, true);
              }
          }
  
          QueryResponse res1 = slrHelp.queryResults("dontKnow1 ", null);
          SolrDocumentList ids1 = res1.getResults();
          int count1 = ids1.size();
          System.out.println("before delete::" + count);
          System.out.println("after delete::" + count1);
  </code></pre>
  
  <p><strong>output:</strong></p>
  
  <pre><code>See my id SolrDocument[{contid=3BAC9EE84691380265257EEB002BAA77, cmrights=[dummy, dummy1, dummy2], dbtype=MAIL, subject=NotesSlrWriter123, sendto=receiver@gmial123.com, frommail=sender@gmail123.com, posteddate=Tue Oct 27 13:26:57 IST 2015}]
  See my id SolrDocument[{contid=F92F9D8BBD65F36365257EEB0040DEFE, cmrights=[dummy, dummy1, dummy2], dbtype=MAIL, subject=NotesSlrWriter123, sendto=receiver@gmial123.com, frommail=sender@gmail123.com, posteddate=Tue Oct 27 17:18:33 IST 2015}]
  before delete::2
  after delete::2
  </code></pre>
  
  <p>so here what i am trying to do is getting database then <code>NotesSolrWrite</code> use for indexing my notes document and saving on server, so in <code>res</code> as expected there are two such documents which satisfied query condition and <code>count.size</code> gives number of documents which are selected, and i am printing count's values . </p>
  
  <p>so my problem is now i want to delete this documents  from the the server</p>
  
  <p>but i don't know whether i am doing right, after my deleting code still i am getting those documents on server. how to delete that any other way ??</p>
  
  <p>it would be nice if anyone help me </p>