code: def _locked_refresh_doc_ids(self):
          
          d = {}
          for s in self._shards:
              for k in s.doc_index.keys():
                  if k in d:
                      raise KeyError('doc "{i}" found in multiple repos'.format(i=k))
                  d[k] = s
          self._doc2shard_map = d
docs: Assumes that the caller has the _index_lock !