public function addDocument($indexName, $indexType, $document, $uid)
    {
        if ("" === $indexName && $document instanceof DocumentReference) {
            $indexName = $document->getIndexName();
        } else {
            $indexName = $this->indexNamePrefix . $indexName;
        }

        $this->mapProviders(function (SearchProviderInterface $provider) use ($document, $uid, $indexName, $indexType) {
            $provider->addDocument($document, $uid, $indexName, $indexType);
        });
    }