Permalink
Browse files

fix bulk delete

  • Loading branch information...
1 parent 23f54b0 commit 71093eb74aa117e1f05142d46c22bc0f3a612773 Leandro Oniszczuk committed Aug 19, 2011
Showing with 2 additions and 4 deletions.
  1. +1 −0 Indextank/Api.php
  2. +1 −4 Indextank/Index.php
View
@@ -74,6 +74,7 @@ public function api_call($method, $url, $params = array(), $http_options = array
{
if ($method == "GET" || $method == "DELETE") {
$args = http_build_query($params);
+ $args = preg_replace('/%5B(?:[0-9]|[1-9][0-9]+)%5D=/', '=', $args);
@dbuthay

dbuthay Aug 19, 2011

Owner

what is that supposed to do ?

$url .= '?' . $args;
$args = '';
} else {
View
@@ -233,10 +233,7 @@ public function delete_documents($docids) {
* Arguments:
* docids: unique document identifiers
*/
- $data = array();
- foreach ($docids as $docid) {
- $data[] = array("docid" => $docid);
- }
+ $data = array("docid" => $docids);
$res = $this->api->api_call('DELETE', $this->docs_url(), $data);
return json_decode($res->response);
}

0 comments on commit 71093eb

Please sign in to comment.