Commit 8e87e895 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "elasticsearch: Add index name to _bulk command path"

parents dbdeb077 278889b5
......@@ -9,3 +9,5 @@ This library is used for for interfacing with an elasticsearch server.
* Removed build & test files not needed for Mahara.
* Added an option to do include the Elasticsearch Index in the URL for bulk addDocument calls
\ No newline at end of file
......@@ -291,15 +291,19 @@ class Client
* @link
* @param array|\Elastica\Document[] $docs Array of Elastica\Document
* @param string|\Elastica\Index (Optional) If all of the documents are for the same index
* @return \Elastica\Bulk\ResponseSet Response object
public function addDocuments(array $docs)
public function addDocuments(array $docs, Index $index = null)
if (empty($docs)) {
throw new InvalidException('Array has to consist of at least one element');
$bulk = new Bulk($this);
if ($index) {
......@@ -145,7 +145,7 @@ class Index implements SearchableInterface
return $this->getClient()->addDocuments($docs);
return $this->getClient()->addDocuments($docs, $this);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment