Search code examples
solrsolrj

Difference between "Num Docs" and "Max Doc" in Solr


Can someone let me know what is the difference between Num Docs and Max Doc reported in Solr Admin?

I am seeing this difference in value after executing deleteByQuery from SolrJ. I am using Solr 5.2.1

enter image description here


Solution

  • Max Doc indicates the count of document that exist before the update(delete).documents that existed in your index before update started(delete started)

    Num Docs is the new count after the update i.e. the current count.

    In your case you have delete operation where it deleted 2 documents.

    And I guess you must be using DIH....where DIH deletes all docs and add them new again. and after DIH commits it will keep the new one and delete the older ones.