Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
mahara
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
mahara
mahara
Commits
8e87e895
Commit
8e87e895
authored
Jun 09, 2015
by
Robert Lyon
Committed by
Gerrit Code Review
Jun 09, 2015
Browse files
Options
Browse Files
Download
Plain Diff
Merge "elasticsearch: Add index name to _bulk command path"
parents
dbdeb077
278889b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
htdocs/lib/elastica/README.Mahara
htdocs/lib/elastica/README.Mahara
+3
-1
htdocs/lib/elastica/lib/Elastica/Client.php
htdocs/lib/elastica/lib/Elastica/Client.php
+5
-1
htdocs/lib/elastica/lib/Elastica/Index.php
htdocs/lib/elastica/lib/Elastica/Index.php
+1
-1
No files found.
htdocs/lib/elastica/README.Mahara
View file @
8e87e895
...
...
@@ -8,4 +8,6 @@ This library is used for for interfacing with an elasticsearch server.
Changes:
* Removed build & test files not needed for Mahara.
\ No newline at end of file
* 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
htdocs/lib/elastica/lib/Elastica/Client.php
View file @
8e87e895
...
...
@@ -291,15 +291,19 @@ class Client
* @link http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
*
* @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
)
{
$bulk
->
setIndex
(
$index
);
}
$bulk
->
addDocuments
(
$docs
);
...
...
htdocs/lib/elastica/lib/Elastica/Index.php
View file @
8e87e895
...
...
@@ -145,7 +145,7 @@ class Index implements SearchableInterface
$doc
->
setIndex
(
$this
->
getName
());
}
return
$this
->
getClient
()
->
addDocuments
(
$docs
);
return
$this
->
getClient
()
->
addDocuments
(
$docs
,
$this
);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment