Always show text, make text extract size configurable.
[phinde.git] / bin / setup.php
1 #!/usr/bin/env php
2 <?php
3 namespace phinde;
4 /**
5  * Configure the elasticsearch index.
6  * Throws away all data.
7  */
8 require_once __DIR__ . '/../src/init.php';
9
10 //delete old index
11 $r = new Elasticsearch_Request(
12     $GLOBALS['phinde']['elasticsearch'],
13     \HTTP_Request2::METHOD_DELETE
14 );
15 $r->allow404 = true;
16 $r->send();
17
18 //recreate it
19 $r = new Elasticsearch_Request(
20     $GLOBALS['phinde']['elasticsearch'],
21     \HTTP_Request2::METHOD_PUT
22 );
23 $r->setBody(
24     file_get_contents(__DIR__ . '/../data/elasticsearch-mapping.json')
25 );
26 $r->send();
27 ?>