fix indexing, boost config
[phinde.git] / bin / setup.php
1 #!/usr/bin/env php
2 <?php
3 namespace phinde;
4 //configure the elasticsearch index
5 require_once __DIR__ . '/../src/init.php';
6
7 //delete old index
8 $r = new Elasticsearch_Request(
9     $GLOBALS['phinde']['elasticsearch'],
10     \HTTP_Request2::METHOD_DELETE
11 );
12 $r->allow404 = true;
13 $r->send();
14
15 //recreate it
16 $r = new Elasticsearch_Request(
17     $GLOBALS['phinde']['elasticsearch'],
18     \HTTP_Request2::METHOD_PUT
19 );
20 $r->setBody(
21     file_get_contents(__DIR__ . '/../data/elasticsearch-mapping.json')
22 );
23 $r->send();
24 ?>