Merge pull request #402 from idlead/master

Fix a race condition on index' doc count retrieval