lib/Handler.php
public function bulkIndexContent(array $contentObjects)
    {
        $documents = array();

        foreach ($contentObjects as $content) {
            try {
                $documents[] = $this->mapper->mapContentBlock($content);
            } catch (NotFoundException $ex) {
                // ignore content objects without assigned state id
            }
        }

        if (!empty($documents)) {
            $this->gateway->bulkIndexDocuments($documents);
        }
    }
public function bulkIndexContent(array $contentObjects)
    {
        $documents = array();

        foreach ($contentObjects as $content) {
            try {
                $documents[] = $this->mapper->mapContentBlock($content);
            } catch (NotFoundException $ex) {
                // ignore content objects without assigned state id
            }
        }

        if (!empty($documents)) {
            $this->gateway->bulkIndexDocuments($documents);
        }
    }
Indexes several content objects.

Notes:
- Does not force a commit on solr, depends on solr config, use {@see commit()} if you need that.
- On large amounts of data make sure to iterate with several calls to this function with a limited
set of content objects, amount you have memory for depends on server, size of objects, & PHP version.

@todo: This method & {@see commit()} is needed for being able to bulk index content, and then afterwards commit.
However it is not added to an official SPI interface yet as we anticipate adding a bulkIndexDocument
using eZ\Publish\SPI\Search\Document instead of bulkIndexContent based on Content objects. However
that won't be added until we have several stable or close to stable advance search engines to make
sure we match the features of these.
See also {@see Solr\Content\Search\Gateway\Native::bulkIndexContent} for further Solr specific info.

@param \eZ\Publish\SPI\Persistence\Content[] $contentObjects