public function refresh(array $options = [])
    {
        $response = $this->collection->getKuzzle()->query(
            $this->collection->buildQueryArgs('collection', 'getMapping'),
            $this->collection->getKuzzle()->addHeaders([], $this->headers),
            $options
        );

        if (array_key_exists($this->collection->getIndexName(), $response['result'])) {
            $indexMappings = $response['result'][$this->collection->getIndexName()]['mappings'];

            if (array_key_exists($this->collection->getCollectionName(), $indexMappings)) {
                $this->mapping = $indexMappings[$this->collection->getCollectionName()]['properties'];
            } else {
                throw new ErrorException('No mapping found for collection ' . $this->collection->getCollectionName());
            }
        } else {
            throw new ErrorException('No mapping found for index ' . $this->collection->getIndexName());
        }

        return $this;
    }