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);
        });
    }
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);
        });
    }
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 ) ; } ) ; }
Add a document to the index

@param string $indexName Name of the index
@param string $indexType Type of the index to add the document to
@param array $document The document to index
@param string $uid Unique ID for this document, this will allow the document to be overwritten by new data
instead of being duplicated
Add a document to the index