aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2012-05-01 21:31:46 +0200
committerChristian Weiske <cweiske@cweiske.de>2012-05-01 21:31:46 +0200
commit06524ec25d81c383bc801dee70582a42b348303c (patch)
treeb94abe67ef99990eb7bca43fbb29a3e8173f657a /scripts
parent9e1b6dbecf1ebc160b8ceca14ecade816638790b (diff)
downloadphorkie-06524ec25d81c383bc801dee70582a42b348303c.tar.gz
phorkie-06524ec25d81c383bc801dee70582a42b348303c.zip
use configured elasticsearch address
Diffstat (limited to 'scripts')
-rw-r--r--scripts/index.php12
-rw-r--r--scripts/search.php2
2 files changed, 6 insertions, 8 deletions
diff --git a/scripts/index.php b/scripts/index.php
index 9a93488..893e3fb 100644
--- a/scripts/index.php
+++ b/scripts/index.php
@@ -26,7 +26,7 @@ if ($GLOBALS['phorkie']['cfg']['setupcheck']) {
//delete all repos
$r = new \HTTP_Request2(
- 'http://localhost:9200/phorkie/repo/_query',
+ $GLOBALS['phorkie']['cfg']['elasticsearch'] . 'repo/_query',
\HTTP_Request2::METHOD_DELETE
);
$r->setBody(
@@ -38,7 +38,7 @@ $r->setBody(
);
$r->send();
$r = new \HTTP_Request2(
- 'http://localhost:9200/phorkie/file/_query',
+ $GLOBALS['phorkie']['cfg']['elasticsearch'] . 'file/_query',
\HTTP_Request2::METHOD_DELETE
);
$r->setBody(
@@ -52,7 +52,7 @@ $r->send();
//create mapping
$r = new \HTTP_Request2(
- 'http://localhost:9200/phorkie/file/_mapping',
+ $GLOBALS['phorkie']['cfg']['elasticsearch'] . 'file/_mapping',
\HTTP_Request2::METHOD_PUT
);
$r->setBody(
@@ -74,8 +74,7 @@ $r->send();
$rs = new Repositories();
foreach ($rs->getList(0, 10000) as $repo) {
$r = new \HTTP_Request2(
- //FIXME: make configurable
- 'http://localhost:9200/phorkie/repo/' . $repo->id,
+ $GLOBALS['phorkie']['cfg']['elasticsearch'] . 'repo/' . $repo->id,
\HTTP_Request2::METHOD_PUT
);
$r->setBody(
@@ -90,8 +89,7 @@ foreach ($rs->getList(0, 10000) as $repo) {
foreach ($repo->getFiles() as $file) {
$r = new \HTTP_Request2(
- //FIXME: make configurable
- 'http://localhost:9200/phorkie/file/?parent=' . $repo->id,
+ $GLOBALS['phorkie']['cfg']['elasticsearch'] . 'file/?parent=' . $repo->id,
\HTTP_Request2::METHOD_POST
);
$r->setBody(
diff --git a/scripts/search.php b/scripts/search.php
index af7a085..f9688bb 100644
--- a/scripts/search.php
+++ b/scripts/search.php
@@ -25,7 +25,7 @@ if ($GLOBALS['phorkie']['cfg']['setupcheck']) {
}
$r = new \HTTP_Request2(
- 'http://localhost:9200/phorkie/repo/_search',
+ $GLOBALS['phorkie']['cfg']['elasticsearch'] . 'repo/_search',
\HTTP_Request2::METHOD_GET
);
$r->setBody(