code: def remove(self, key, preserve_data=False):
          
          if self.members.remove(key) != 1:
              raise KeyError('Document with key "%s" not found.' % key)
          document_hash = self._get_hash(key)
          content = decode(document_hash['content'])
          if not preserve_data:
              document_hash.clear()
  
          for word in self.tokenizer.tokenize(content):
              word_key = self.get_key(word)
              del word_key[key]
              if len(word_key) == 0:
                  word_key.clear()
docs: :param key: Document unique identifier.
  
          Remove the document from the search index.