eZ\Publish\Core\Search\Elasticsearch\Content\Gateway::bulkIndex PHP Method

bulkIndex() abstract public method

Performs bulk index of a given array of documents.
abstract public bulkIndex ( array $documents )
$documents array
    public abstract function bulkIndex(array $documents);

Usage Example

示例#1
0
 /**
  * Indexes several Locations
  *
  * @todo: This function and setCommit() is needed for Persistence\Solr for test speed but not part
  *       of interface for the reason described in Solr\Content\Search\Gateway\Native::bulkIndexContent
  *       Short: Bulk handling should be properly designed before added to the interface.
  *
  * @param \eZ\Publish\SPI\Persistence\Content\Location[] $locations
  */
 public function bulkIndexLocations(array $locations)
 {
     $documents = array();
     foreach ($locations as $location) {
         $documents[] = $this->mapper->mapLocation($location);
     }
     $this->gateway->bulkIndex($documents);
 }
All Usage Examples Of eZ\Publish\Core\Search\Elasticsearch\Content\Gateway::bulkIndex