aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2014-11-05 13:35:48 +0100
committerChristian Weiske <cweiske@cweiske.de>2014-11-05 13:35:48 +0100
commit3208b3513fb9a8d0e5b4e00701d0e902c1b6107a (patch)
tree73334dea53717bb535613fe5789766d51a68621e /src
parentfc9ddff30bafd071990dfb95c9a8520b457da2e9 (diff)
downloadphorkie-3208b3513fb9a8d0e5b4e00701d0e902c1b6107a.tar.gz
phorkie-3208b3513fb9a8d0e5b4e00701d0e902c1b6107a.zip
make phorkie compatible with elasticsearch 1.3
Diffstat (limited to 'src')
-rw-r--r--src/phorkie/Database/Adapter/Elasticsearch/Indexer.php34
1 files changed, 5 insertions, 29 deletions
diff --git a/src/phorkie/Database/Adapter/Elasticsearch/Indexer.php b/src/phorkie/Database/Adapter/Elasticsearch/Indexer.php
index e93cfa7..6da974a 100644
--- a/src/phorkie/Database/Adapter/Elasticsearch/Indexer.php
+++ b/src/phorkie/Database/Adapter/Elasticsearch/Indexer.php
@@ -117,30 +117,15 @@ class Database_Adapter_Elasticsearch_Indexer implements Database_IIndexer
public function deleteAllRepos()
{
$r = new Database_Adapter_Elasticsearch_HTTPRequest(
- $this->searchInstance . 'repo/_query',
+ $this->searchInstance . 'repo',
\HTTP_Request2::METHOD_DELETE
);
- $r->allow404 = true;
- $r->setBody(
- json_encode(
- (object)array(
- 'match_all' => (object)array()
- )
- )
- );
$r->send();
+
$r = new Database_Adapter_Elasticsearch_HTTPRequest(
- $this->searchInstance . 'file/_query',
+ $this->searchInstance . 'file',
\HTTP_Request2::METHOD_DELETE
);
- $r->allow404 = true;
- $r->setBody(
- json_encode(
- (object)array(
- 'match_all' => (object)array()
- )
- )
- );
$r->send();
}
@@ -161,19 +146,10 @@ class Database_Adapter_Elasticsearch_Indexer implements Database_IIndexer
{
//delete files of that repository
$r = new Database_Adapter_Elasticsearch_HTTPRequest(
- $this->searchInstance . 'file/_query',
+ $this->searchInstance . 'file/_query'
+ . '?q=_parent:' . $repo->id,
\HTTP_Request2::METHOD_DELETE
);
- $r->allow404 = true;
- $r->setBody(
- json_encode(
- (object)array(
- 'field' => (object)array(
- '_parent' => $repo->id
- )
- )
- )
- );
$r->send();
}