code: def remove(self, obj_id, obj_type=None):
          
          if not self.exists(obj_id, obj_type):
              raise KeyError('Object not found.')
  
          combined_id = self.object_key(obj_id, obj_type)
          title = self._title_data[combined_id]
  
          for word in self.tokenize_title(title):
              for substring in self.substrings(word):
                  key = self.word_key(substring)
                  if not self.database.zrange(key, 1, 2):
                      self.database.delete(key)
                  else:
                      self.database.zrem(key, combined_id)
  
          del self._data[combined_id]
          del self._title_data[combined_id]
          del self._boosts[combined_id]
docs: Remove an object identified by the given ``obj_id`` (and
          optionally ``obj_type``) from the search index.
  
          :param obj_id: The object's unique identifier.
          :param obj_type: The object's type.